Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Fix error msg for schema parsing

  • Loading branch information...
commit 96f7ae61da5d8c3ca7ff420af1ca71462744ec98 1 parent 4c554d2
John Jawed (JJ) authored

Showing 1 changed file with 0 additions and 94 deletions. Show diff stats Hide diff stats

  1. +0 94 xcom.c
94 xcom.c
@@ -512,100 +512,6 @@ static char* php_xcom_avro_record_from_obj(zval *obj, char *json_schema TSRMLS_D
512 512 avro_schema_from_json(json_schema, strlen(json_schema), &schema, &error);
513 513
514 514 if(schema==NULL) {
515   - php_error_docref(NULL TSRMLS_CC,
516   - }
517   - snprintf(req->uri, sizeof(req->uri), "%s/%s", xcom->fabric_url, topic);
518   -
519   - debug = zend_read_property(xcom_ce, obj, "__debug", sizeof("__debug")-1, 0 TSRMLS_CC);
520   -
521   - req->debug = debug ? Z_BVAL_P(debug) : 0;
522   -
523   - req->debug = 0;
524   -
525   - if(async) {
526   - req->payload = strdup(msg);
527   - req->debug = debug ? Z_BVAL_P(debug) : 0;
528   - pthread_create(&thr, &pthread_attrs, php_xcom_send_msg, (void*)req);
529   - resp_code = 0L;
530   - } else {
531   - req->xcom = xcom;
532   - req->payload = msg;
533   - php_xcom_send_msg(req);
534   - resp_code = req->response_code;
535   - efree(req);
536   - }
537   -
538   - RETVAL_LONG(resp_code);
539   -
540   - if(msg) {
541   - efree(msg);
542   - }
543   -
544   - return NULL;
545   -}
546   -
547   -static char* php_xcom_avro_record_from_obj(zval *obj, char *json_schema TSRMLS_DC) /* {{{ */
548   -{
549   - int i;
550   - HashTable *myht;
551   - char *msg_buf = NULL;
552   - avro_writer_t writer = NULL;
553   - avro_value_t val;
554   - size_t writer_bytes = 0;
555   - avro_schema_t schema = NULL;
556   - avro_schema_error_t error = NULL;
557   - avro_value_iface_t *iface;
558   -
559   - avro_schema_from_json(json_schema, strlen(json_schema), &schema, &error);
560   -
561   - if(schema==NULL) {
562   - php_error_docref(NULL TSRMLS_CC,
563   - }
564   - snprintf(req->uri, sizeof(req->uri), "%s/%s", xcom->fabric_url, topic);
565   -
566   - debug = zend_read_property(xcom_ce, obj, "__debug", sizeof("__debug")-1, 0 TSRMLS_CC);
567   -
568   - req->debug = debug ? Z_BVAL_P(debug) : 0;
569   -
570   - req->debug = 0;
571   -
572   - if(async) {
573   - req->payload = strdup(msg);
574   - req->debug = debug ? Z_BVAL_P(debug) : 0;
575   - pthread_create(&thr, &pthread_attrs, php_xcom_send_msg, (void*)req);
576   - resp_code = 0L;
577   - } else {
578   - req->xcom = xcom;
579   - req->payload = msg;
580   - php_xcom_send_msg(req);
581   - resp_code = req->response_code;
582   - efree(req);
583   - }
584   -
585   - RETVAL_LONG(resp_code);
586   -
587   - if(msg) {
588   - efree(msg);
589   - }
590   -
591   - return NULL;
592   -}
593   -
594   -static char* php_xcom_avro_record_from_obj(zval *obj, char *json_schema TSRMLS_DC) /* {{{ */
595   -{
596   - int i;
597   - HashTable *myht;
598   - char *msg_buf = NULL;
599   - avro_writer_t writer = NULL;
600   - avro_value_t val;
601   - size_t writer_bytes = 0;
602   - avro_schema_t schema = NULL;
603   - avro_schema_error_t error = NULL;
604   - avro_value_iface_t *iface;
605   -
606   - avro_schema_from_json(json_schema, strlen(json_schema), &schema, &error);
607   -
608   - if(schema==NULL) {
609 515 php_error_docref(NULL TSRMLS_CC, E_ERROR, "invalid schema: %s", avro_strerror());
610 516 return NULL;
611 517 }

0 comments on commit 96f7ae6

Please sign in to comment.
Something went wrong with that request. Please try again.