log NULL continue_callback with SF_NIO_STAGE_CONTINUE
parent
1b4e0ad870
commit
11165cbb20
13
src/sf_nio.c
13
src/sf_nio.c
|
|
@ -312,6 +312,9 @@ int sf_nio_notify(struct fast_task_info *task, const int stage)
|
|||
if (task->continue_callback != NULL) {
|
||||
return task->continue_callback(task);
|
||||
} else {
|
||||
logWarning("file: "__FILE__", line: %d, "
|
||||
"task %p, continue_callback is NULL",
|
||||
__LINE__, task);
|
||||
return 0;
|
||||
}
|
||||
} else {
|
||||
|
|
@ -398,10 +401,14 @@ void sf_recv_notify_read(int sock, short event, void *arg)
|
|||
} else {
|
||||
stage = __sync_add_and_fetch(&task->nio_stages.notify, 0);
|
||||
if (stage != SF_NIO_STAGE_NONE) {
|
||||
if (stage == SF_NIO_STAGE_CONTINUE &&
|
||||
task->continue_callback != NULL)
|
||||
{
|
||||
if (stage == SF_NIO_STAGE_CONTINUE) {
|
||||
if (task->continue_callback != NULL) {
|
||||
task->continue_callback(task);
|
||||
} else {
|
||||
logWarning("file: "__FILE__", line: %d, "
|
||||
"task %p, continue_callback is NULL",
|
||||
__LINE__, task);
|
||||
}
|
||||
}
|
||||
__sync_bool_compare_and_swap(&task->nio_stages.notify,
|
||||
stage, SF_NIO_STAGE_NONE);
|
||||
|
|
|
|||
|
|
@ -65,7 +65,7 @@ typedef struct sf_context {
|
|||
typedef struct {
|
||||
int body_len; //body length
|
||||
short flags;
|
||||
short status;
|
||||
volatile short status;
|
||||
unsigned char cmd; //command
|
||||
} SFHeaderInfo;
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue