]> granicus.if.org Git - php/commitdiff
Revert "Add some const-ness to the protocol frame codec"
authorAndrey Hristov <andrey@php.net>
Tue, 17 Nov 2015 16:55:32 +0000 (17:55 +0100)
committerAndrey Hristov <andrey@php.net>
Tue, 17 Nov 2015 16:55:32 +0000 (17:55 +0100)
This reverts commit f8c2b459481209c3761a694baa6f38060dc9875a.

ext/mysqlnd/mysqlnd_protocol_frame_codec.c
ext/mysqlnd/mysqlnd_structs.h

index 092380038f566b9b35f734375188f46b17713ea3..a6b03df0c39b51f8037a1eb3a089c7e266bd486e 100644 (file)
@@ -62,14 +62,14 @@ MYSQLND_METHOD(mysqlnd_pfc, reset)(MYSQLND_PFC * const pfc, MYSQLND_STATS * cons
   count + MYSQLND_HEADER_SIZE = sizeof(buffer) (not the pointer but the actual buffer)
 */
 static size_t
-MYSQLND_METHOD(mysqlnd_pfc, send)(MYSQLND_PFC * const pfc, MYSQLND_VIO * const vio, const zend_uchar * const buffer, const size_t count,
+MYSQLND_METHOD(mysqlnd_pfc, send)(MYSQLND_PFC * const pfc, MYSQLND_VIO * const vio, zend_uchar * const buffer, const size_t count,
                                                                  MYSQLND_STATS * const conn_stats, MYSQLND_ERROR_INFO * const error_info)
 {
        zend_uchar safe_buf[((MYSQLND_HEADER_SIZE) + (sizeof(zend_uchar)) - 1) / (sizeof(zend_uchar))];
        zend_uchar * safe_storage = safe_buf;
        size_t bytes_sent, packets_sent = 1;
        size_t left = count;
-       const zend_uchar * p = buffer;
+       zend_uchar * p = (zend_uchar *) buffer;
        zend_uchar * compress_buf = NULL;
        size_t to_be_sent;
 
@@ -93,7 +93,7 @@ MYSQLND_METHOD(mysqlnd_pfc, send)(MYSQLND_PFC * const pfc, MYSQLND_VIO * const v
                        /* here we need to compress the data and then write it, first comes the compressed header */
                        size_t tmp_complen = to_be_sent;
                        size_t payload_size;
-                       const zend_uchar * uncompressed_payload = p; /* should include the header */
+                       zend_uchar * uncompressed_payload = p; /* should include the header */
 
                        STORE_HEADER_SIZE(safe_storage, uncompressed_payload);
                        int3store(uncompressed_payload, to_be_sent);
index 0402339a5bbc9c4437ca0bf8591e1c371cfe246a..3df7c61f2615d53635421b4fd9807efcbc552701 100644 (file)
@@ -1075,7 +1075,7 @@ typedef enum_func_status  (*func_mysqlnd_pfc__reset)(MYSQLND_PFC * const pfc, MYS
 typedef enum_func_status       (*func_mysqlnd_pfc__set_client_option)(MYSQLND_PFC * const pfc, enum_mysqlnd_client_option option, const char * const value);
 typedef enum_func_status       (*func_mysqlnd_pfc__decode)(zend_uchar * uncompressed_data, const size_t uncompressed_data_len, const zend_uchar * const compressed_data, const size_t compressed_data_len);
 typedef enum_func_status       (*func_mysqlnd_pfc__encode)(zend_uchar * compress_buffer, size_t * compress_buffer_len, const zend_uchar * const uncompressed_data, const size_t uncompressed_data_len);
-typedef size_t                         (*func_mysqlnd_pfc__send)(MYSQLND_PFC * const pfc, MYSQLND_VIO * const vio, const zend_uchar * const buffer, const size_t count, MYSQLND_STATS * const conn_stats, MYSQLND_ERROR_INFO * const error_info);
+typedef size_t                         (*func_mysqlnd_pfc__send)(MYSQLND_PFC * const pfc, MYSQLND_VIO * const vio, zend_uchar * const buffer, const size_t count, MYSQLND_STATS * const conn_stats, MYSQLND_ERROR_INFO * const error_info);
 typedef enum_func_status       (*func_mysqlnd_pfc__receive)(MYSQLND_PFC * const pfc, MYSQLND_VIO * const vio, zend_uchar * const buffer, const size_t count, MYSQLND_STATS * const conn_stats, MYSQLND_ERROR_INFO * const error_info);
 typedef enum_func_status       (*func_mysqlnd_pfc__read_compressed_packet_from_stream_and_fill_read_buffer)(MYSQLND_PFC * pfc, MYSQLND_VIO * const vio, size_t net_payload_size, MYSQLND_STATS * conn_stats, MYSQLND_ERROR_INFO * error_info);
 typedef void                           (*func_mysqlnd_pfc__free_contents)(MYSQLND_PFC * pfc);