struct sf_shared_mbuffer: Must move buff to last
parent
8b22655352
commit
a0f16319e0
|
|
@ -620,7 +620,6 @@ int sf_client_sock_read(int sock, short event, void *arg)
|
|||
task->recv_body = SF_CTX->alloc_recv_buffer(task,
|
||||
task->length - SF_CTX->header_size, &new_alloc);
|
||||
if (new_alloc && task->recv_body == NULL) {
|
||||
logInfo("recv_body is NULL!!!!!!!!!!!!!!!!!");
|
||||
ioevent_add_to_deleted_list(task);
|
||||
return -1;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -21,7 +21,6 @@ static int sf_shared_mbuffer_alloc_init(void *element, void *args)
|
|||
|
||||
buffer = (SFSharedMBuffer *)((char *)element +
|
||||
sizeof(struct fast_allocator_wrapper));
|
||||
buffer->buff = (char *)(buffer + 1);
|
||||
buffer->ctx = (SFSharedMBufferContext *)args;
|
||||
return 0;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -27,10 +27,10 @@ typedef struct sf_shared_mbuffer_context {
|
|||
} SFSharedMBufferContext;
|
||||
|
||||
typedef struct sf_shared_mbuffer {
|
||||
char *buff;
|
||||
int length;
|
||||
volatile int reffer_count;
|
||||
SFSharedMBufferContext *ctx;
|
||||
char buff[0]; //must be last
|
||||
} SFSharedMBuffer;
|
||||
|
||||
#ifdef __cplusplus
|
||||
|
|
|
|||
Loading…
Reference in New Issue