Commit Graph

77 Commits (0cb7c27d9cfafe83acb9c309a0f913b8993f82b5)

Author SHA1 Message Date
Pieter Noordhuis 0cb7c27d9c Update license 2011-04-21 22:46:23 +02:00
Pieter Noordhuis 8419b060f2 Handle OOM when doing blocking requests 2011-04-21 21:34:43 +02:00
Pieter Noordhuis d4ebb60d65 More OOM checks in the protocol reader 2011-04-21 18:50:10 +02:00
Pieter Noordhuis 965d42640f Rename *ReplyReader* to *Reader* 2011-04-21 16:03:32 +02:00
Pieter Noordhuis 0ee7c66818 Use static buffer for error string on context 2011-04-21 15:56:22 +02:00
Pieter Noordhuis 6d207ea98e Create protocol reader when creating context 2011-04-21 15:04:42 +02:00
Pieter Noordhuis 58caf62a52 Move prototypes around in header 2011-04-21 14:39:03 +02:00
Pieter Noordhuis a926232293 Reply object functions can be set by the user after creating the reader 2011-04-21 14:37:29 +02:00
Pieter Noordhuis 5ba49014da Privdata can be set directly on the struct 2011-04-21 14:34:03 +02:00
Pieter Noordhuis 2002218981 Remove useless casts 2011-04-21 14:31:02 +02:00
Pieter Noordhuis 026636b0cd Remove accessor functions now the redisReader struct is public 2011-04-21 14:27:03 +02:00
Pieter Noordhuis f0307c6172 Move definitions around 2011-04-21 14:23:59 +02:00
Pieter Noordhuis 41d4d9c6f4 Forward declaration is not necessary 2011-04-21 14:22:27 +02:00
Pieter Noordhuis 727e1babec Make redisReader struct public 2011-04-21 14:21:58 +02:00
Pieter Noordhuis eaf58bd32a Use pre-allocated buffer for error strings in reader 2011-04-20 17:06:19 +02:00
Pieter Noordhuis 2fc0d8756e Use select(2) for enforce a timeout on blocking connect(2) 2011-02-04 15:26:28 +01:00
Pieter Noordhuis 864bce944b redisReplyReaderFeed should take a const char* 2011-01-27 14:07:06 +01:00
Pieter Noordhuis fbe756d838 Avoid warnings with -Wstrict-prototypes 2011-01-27 12:50:55 +01:00
Pieter Noordhuis 43ab0f8018 Return error on socket timeout for a blocking context 2011-01-07 13:04:42 +01:00
Pieter Noordhuis 3ce8d5b08b Change reply processing code to prepare for pub/sub 2010-12-31 15:49:21 +01:00
Pieter Noordhuis 29ea901b24 Fix the async free() and disconnect() functions
To make sure that these functions can also be called from functions
other than command callbacks, the flag IN_CALLBACK is introduced that
holds whether the context is currently executing a callback. If so,
redisAsyncFree() and redisAsyncDisconnect() should delegate their task
to the reply processor to avoid segfaults.
2010-12-28 20:29:29 +01:00
Pieter Noordhuis e3776bfaa6 Add function to explicitly free an async context 2010-12-28 19:19:25 +01:00
Pieter Noordhuis 0fbfa45f23 Bump version 2010-12-16 23:22:13 +01:00
Pieter Noordhuis a1e2c6dfed Add myself to license in some files 2010-12-16 22:08:46 +01:00
Pieter Noordhuis 2ef9c2e5f7 Redefine REDIS_REPLY_ERROR to be non-zero
When no reply object functions are defined, the reply type integer is
returned from redisGetReply(). This sets the *reply argument to the
consumed reply, where 0 means that it was not possible to consume a full
reply. With REDIS_REPLY_ERROR having the same value, there is no way to
tell the difference between an error reply and not consuming a reply.
2010-12-16 21:50:37 +01:00
Pieter Noordhuis 89c6927282 Bump version 2010-11-26 15:31:53 +01:00
Pieter Noordhuis adb0895e99 Rename 'parent' field in read tasks to 'obj' 2010-11-26 13:04:42 +01:00
Pieter Noordhuis d4058be7b0 Add pointer to parent task in read tasks 2010-11-24 15:21:34 +01:00
Pieter Noordhuis 1927c643da Add privdata field to reply reader
This field is set in the read tasks that are passed to the reply object
functions. This allows to curry arbitrary data to these functions.
2010-11-24 12:27:46 +01:00
Ryan Tecco 74254a3b39 add extern "C" for C++ compiles 2010-11-19 12:25:04 +01:00
Pieter Noordhuis 8b616d3547 The buffer length to feed should be a size_t 2010-11-04 20:55:03 +01:00
Pieter Noordhuis 2e5e9a49fd Return the reply type when the reply object function set is NULL 2010-11-04 13:15:44 +01:00
Pieter Noordhuis 3be1d6e66d Add version information to hiredis.h 2010-11-03 11:50:46 +01:00
Pieter Noordhuis f25a5267cc Allow to connect using a unix socket from hiredis 2010-11-03 11:38:26 +01:00
Pieter Noordhuis e13674dd4e Expose redisGetReplyFromReader as public API 2010-11-03 00:40:07 +01:00
Pieter Noordhuis b8b296654d Strip net.c down to the bare minimum 2010-11-02 17:09:26 +01:00
Pieter Noordhuis ffa8666a64 Change error reporting to have an explicit type
When there is an I/O error, errno should be used to find out what is
wrong. In other cases, errno cannot be used. So, use an explicit type in
Hiredis to define the different error scenarios that can occur.
2010-11-02 16:36:38 +01:00
Pieter Noordhuis 5db8008d97 Remove superfluous definition 2010-11-02 14:55:24 +01:00
Pieter Noordhuis 5fa8d30599 There is no longer need for a separate redisDisconnect 2010-11-01 14:20:51 +01:00
Pieter Noordhuis ef995accb2 Strip non-blocking callbacks from hiredis.c 2010-11-01 14:13:03 +01:00
Pieter Noordhuis 4e3bd7893d Add support to lazily disconnect an asynchronous connection 2010-11-01 09:27:43 +01:00
Pieter Noordhuis 6042c569b1 Move include of stdio.h to hiredis.h for size_t 2010-10-31 17:25:20 +01:00
Pieter Noordhuis a0b9f04eaa Move stdarg.h include to the hiredis header file 2010-10-31 14:45:15 +01:00
Pieter Noordhuis 44a2d08b30 The reply object functions may not change the read tasks 2010-10-31 14:44:36 +01:00
Pieter Noordhuis 3f0394b8a9 Use a fixed size stack instead of a dynamic list for read tasks 2010-10-31 14:42:48 +01:00
Pieter Noordhuis f463734e91 Remove reply object functions from connect functions 2010-10-31 12:53:57 +01:00
Pieter Noordhuis 47e1f77149 Refactor internal function flow and add redisAppendCommand* family 2010-10-31 12:34:45 +01:00
Pieter Noordhuis 298e9325d7 First step in decoupling reply callbacks from internals 2010-10-31 10:56:24 +01:00
Pieter Noordhuis a3a405bcba Format a command using an argument vector 2010-10-31 10:34:29 +01:00
Pieter Noordhuis e95c9d4c5b Change redisFormatCommand to return the command in a char*
This allows users of the API to format a command without the need to
have all the sds functions included, only for free'ing the returned
wire-level command.
2010-10-30 20:38:29 +02:00