Skip to content

Commit 53b2e91

Browse files
committed
Update exception error type to E_ERROR.
1 parent 9321d12 commit 53b2e91

File tree

2 files changed

+16
-21
lines changed

2 files changed

+16
-21
lines changed

swoole_client.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -266,13 +266,13 @@ static int php_swoole_client_onRead(swReactor *reactor, swEvent *event)
266266
zcallback = zend_read_property(swoole_client_class_entry_ptr, *zobject, SW_STRL(php_sw_client_onReceive)-1, 0 TSRMLS_CC);
267267
if (zcallback == NULL || ZVAL_IS_NULL(zcallback))
268268
{
269-
php_error_docref(NULL TSRMLS_CC, E_WARNING, "swoole_client: swoole_client object have not receive callback.");
269+
php_error_docref(NULL TSRMLS_CC, E_WARNING, "swoole_client object have not receive callback.");
270270
goto free_zdata;
271271
}
272272

273273
if (call_user_function_ex(EG(function_table), NULL, zcallback, &retval, 2, args, 0, NULL TSRMLS_CC) == FAILURE)
274274
{
275-
php_error_docref(NULL TSRMLS_CC, E_WARNING, "swoole_server: onReactorCallback handler error");
275+
php_error_docref(NULL TSRMLS_CC, E_WARNING, "onReactorCallback handler error");
276276
goto free_zdata;
277277
}
278278
if (retval != NULL)

swoole_server.c

Lines changed: 14 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -227,7 +227,7 @@ static int php_swoole_onReceive(swFactory *factory, swEventData *req)
227227
}
228228
if (EG(exception))
229229
{
230-
zend_exception_error(EG(exception), E_WARNING TSRMLS_CC);
230+
zend_exception_error(EG(exception), E_ERROR TSRMLS_CC);
231231
}
232232
zval_ptr_dtor(&zfd);
233233
zval_ptr_dtor(&zfrom_id);
@@ -297,7 +297,7 @@ static int php_swoole_onTask(swServer *serv, swEventData *req)
297297

298298
if (EG(exception))
299299
{
300-
zend_exception_error(EG(exception), E_WARNING TSRMLS_CC);
300+
zend_exception_error(EG(exception), E_ERROR TSRMLS_CC);
301301
}
302302

303303
zval_ptr_dtor(&zfd);
@@ -363,7 +363,7 @@ static int php_swoole_onFinish(swServer *serv, swEventData *req)
363363
}
364364
if (EG(exception))
365365
{
366-
zend_exception_error(EG(exception), E_WARNING TSRMLS_CC);
366+
zend_exception_error(EG(exception), E_ERROR TSRMLS_CC);
367367
}
368368
zval_ptr_dtor(&ztask_id);
369369
zval_ptr_dtor(&zdata);
@@ -396,7 +396,7 @@ static void php_swoole_onStart(swServer *serv)
396396
}
397397
if (EG(exception))
398398
{
399-
zend_exception_error(EG(exception), E_WARNING TSRMLS_CC);
399+
zend_exception_error(EG(exception), E_ERROR TSRMLS_CC);
400400
}
401401
if (retval != NULL)
402402
{
@@ -421,7 +421,7 @@ static void php_swoole_onManagerStart(swServer *serv)
421421
}
422422
if (EG(exception))
423423
{
424-
zend_exception_error(EG(exception), E_WARNING TSRMLS_CC);
424+
zend_exception_error(EG(exception), E_ERROR TSRMLS_CC);
425425
}
426426
if (retval != NULL)
427427
{
@@ -446,7 +446,7 @@ static void php_swoole_onManagerStop(swServer *serv)
446446
}
447447
if (EG(exception))
448448
{
449-
zend_exception_error(EG(exception), E_WARNING TSRMLS_CC);
449+
zend_exception_error(EG(exception), E_ERROR TSRMLS_CC);
450450
}
451451
if (retval != NULL)
452452
{
@@ -475,7 +475,7 @@ static void php_swoole_onTimer(swServer *serv, int interval)
475475
}
476476
if (EG(exception))
477477
{
478-
zend_exception_error(EG(exception), E_WARNING TSRMLS_CC);
478+
zend_exception_error(EG(exception), E_ERROR TSRMLS_CC);
479479
}
480480
zval_ptr_dtor(&zinterval);
481481
if (retval != NULL)
@@ -500,7 +500,7 @@ static void php_swoole_onShutdown(swServer *serv)
500500
}
501501
if (EG(exception))
502502
{
503-
zend_exception_error(EG(exception), E_WARNING TSRMLS_CC);
503+
zend_exception_error(EG(exception), E_ERROR TSRMLS_CC);
504504
}
505505
if (retval != NULL)
506506
{
@@ -553,7 +553,7 @@ static void php_swoole_onWorkerStart(swServer *serv, int worker_id)
553553
}
554554
if (EG(exception))
555555
{
556-
zend_exception_error(EG(exception), E_WARNING TSRMLS_CC);
556+
zend_exception_error(EG(exception), E_ERROR TSRMLS_CC);
557557
}
558558

559559
zval_ptr_dtor(&zworker_id);
@@ -585,9 +585,8 @@ static void php_swoole_onWorkerStop(swServer *serv, int worker_id)
585585
}
586586
if (EG(exception))
587587
{
588-
zend_exception_error(EG(exception), E_WARNING TSRMLS_CC);
588+
zend_exception_error(EG(exception), E_ERROR TSRMLS_CC);
589589
}
590-
591590
zval_ptr_dtor(&zworker_id);
592591
if (retval != NULL)
593592
{
@@ -624,9 +623,10 @@ static void php_swoole_onWorkerError(swServer *serv, int worker_id, pid_t worker
624623
{
625624
php_error_docref(NULL TSRMLS_CC, E_WARNING, "swoole_server: onWorkerError handler error");
626625
}
626+
627627
if (EG(exception))
628628
{
629-
zend_exception_error(EG(exception), E_WARNING TSRMLS_CC);
629+
zend_exception_error(EG(exception), E_ERROR TSRMLS_CC);
630630
}
631631

632632
zval_ptr_dtor(&zworker_id);
@@ -666,7 +666,7 @@ static void php_swoole_onConnect(swServer *serv, int fd, int from_id)
666666
}
667667
if (EG(exception))
668668
{
669-
zend_exception_error(EG(exception), E_WARNING TSRMLS_CC);
669+
zend_exception_error(EG(exception), E_ERROR TSRMLS_CC);
670670
}
671671

672672
zval_ptr_dtor(&zfd);
@@ -708,7 +708,7 @@ static void php_swoole_onClose(swServer *serv, int fd, int from_id)
708708

709709
if (EG(exception))
710710
{
711-
zend_exception_error(EG(exception), E_WARNING TSRMLS_CC);
711+
zend_exception_error(EG(exception), E_ERROR TSRMLS_CC);
712712
}
713713

714714
zval_ptr_dtor(&zfd);
@@ -869,7 +869,6 @@ PHP_FUNCTION(swoole_server_set)
869869
serv->worker_num = SwooleG.cpu_num;
870870
}
871871
}
872-
873872
//task_worker_num
874873
if (zend_hash_find(vht, ZEND_STRS("task_worker_num"), (void **)&v) == SUCCESS)
875874
{
@@ -913,10 +912,6 @@ PHP_FUNCTION(swoole_server_set)
913912
convert_to_long(*v);
914913
serv->max_request = (int) Z_LVAL_PP(v);
915914
}
916-
else if (serv->factory_mode == SW_MODE_SINGLE)
917-
{
918-
serv->max_request = 0;
919-
}
920915
//task_max_request
921916
if (zend_hash_find(vht, ZEND_STRS("task_max_request"), (void **) &v) == SUCCESS)
922917
{

0 commit comments

Comments
 (0)