trafficserver-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From zw...@apache.org
Subject svn commit: r1071493 - in /trafficserver/traffic/trunk: example/append-transform/ example/blacklist-1/ example/bnull-transform/ example/cache_scan/ example/gzip-transform/ example/null-transform/ example/output-header/ example/protocol/ example/server-...
Date Thu, 17 Feb 2011 03:13:18 GMT
Author: zwoop
Date: Thu Feb 17 03:13:04 2011
New Revision: 1071493

URL: http://svn.apache.org/viewvc?rev=1071493&view=rev
Log:
TS-590 Checkpoint 6, done with IO core as well, and passes regression

Modified:
    trafficserver/traffic/trunk/example/append-transform/append-transform.c
    trafficserver/traffic/trunk/example/blacklist-1/blacklist-1.c
    trafficserver/traffic/trunk/example/bnull-transform/bnull-transform.c
    trafficserver/traffic/trunk/example/cache_scan/cache_scan.cc
    trafficserver/traffic/trunk/example/gzip-transform/gunzip.c
    trafficserver/traffic/trunk/example/gzip-transform/gzip.c
    trafficserver/traffic/trunk/example/null-transform/null-transform.c
    trafficserver/traffic/trunk/example/output-header/output-header.c
    trafficserver/traffic/trunk/example/protocol/Protocol.c
    trafficserver/traffic/trunk/example/server-transform/server-transform.c
    trafficserver/traffic/trunk/example/thread-pool/psi.c
    trafficserver/traffic/trunk/proxy/InkAPITest.cc
    trafficserver/traffic/trunk/proxy/InkIOCoreAPI.cc
    trafficserver/traffic/trunk/proxy/api/ts/InkAPIPrivateIOCore.h
    trafficserver/traffic/trunk/proxy/api/ts/ts.h.in

Modified: trafficserver/traffic/trunk/example/append-transform/append-transform.c
URL: http://svn.apache.org/viewvc/trafficserver/traffic/trunk/example/append-transform/append-transform.c?rev=1071493&r1=1071492&r2=1071493&view=diff
==============================================================================
--- trafficserver/traffic/trunk/example/append-transform/append-transform.c (original)
+++ trafficserver/traffic/trunk/example/append-transform/append-transform.c Thu Feb 17 03:13:04 2011
@@ -76,9 +76,8 @@ static void
 my_data_destroy(MyData * data)
 {
   if (data) {
-    if (data->output_buffer) {
-      ASSERT_SUCCESS(TSIOBufferDestroy(data->output_buffer));
-    }
+    if (data->output_buffer)
+      TSIOBufferDestroy(data->output_buffer);
     TSfree(data);
   }
 }
@@ -131,9 +130,9 @@ handle_transform(TSCont contp)
       TSIOBufferCopy(TSVIOBufferGet(data->output_vio), append_buffer_reader, append_buffer_length, 0);
     }
 
-    ASSERT_SUCCESS(TSVIONBytesSet(data->output_vio, TSVIONDoneGet(write_vio) + append_buffer_length));
+    TSVIONBytesSet(data->output_vio, TSVIONDoneGet(write_vio) + append_buffer_length);
+    TSVIOReenable(data->output_vio);
 
-    ASSERT_SUCCESS(TSVIOReenable(data->output_vio));
     return;
   }
 
@@ -155,11 +154,11 @@ handle_transform(TSCont contp)
 
       /* Tell the read buffer that we have read the data and are no
          longer interested in it. */
-      ASSERT_SUCCESS(TSIOBufferReaderConsume(TSVIOReaderGet(write_vio), towrite));
+      TSIOBufferReaderConsume(TSVIOReaderGet(write_vio), towrite);
 
       /* Modify the write VIO to reflect how much data we've
          completed. */
-      ASSERT_SUCCESS(TSVIONDoneSet(write_vio, TSVIONDoneGet(write_vio) + towrite));
+      TSVIONDoneSet(write_vio, TSVIONDoneGet(write_vio) + towrite);
     }
   }
 
@@ -171,7 +170,7 @@ handle_transform(TSCont contp)
          connection by reenabling the output VIO. This will wakeup
          the output connection and allow it to consume data from the
          output buffer. */
-      ASSERT_SUCCESS(TSVIOReenable(data->output_vio));
+      TSVIOReenable(data->output_vio);
 
       /* Call back the write VIO continuation to let it know that we
          are ready for more data. */
@@ -188,9 +187,8 @@ handle_transform(TSCont contp)
        expect. This allows the output connection to know when it
        is done reading. We then reenable the output connection so
        that it can consume the data we just gave it. */
-    ASSERT_SUCCESS(TSVIONBytesSet(data->output_vio, TSVIONDoneGet(write_vio) + append_buffer_length));
-
-    ASSERT_SUCCESS(TSVIOReenable(data->output_vio));
+    TSVIONBytesSet(data->output_vio, TSVIONDoneGet(write_vio) + append_buffer_length);
+    TSVIOReenable(data->output_vio);
 
     /* Call back the write VIO continuation to let it know that we
        have completed the write operation. */
@@ -341,7 +339,7 @@ load(const char *filename)
 
     err = TSfread(fp, p, avail);
     if (err > 0) {
-      ASSERT_SUCCESS(TSIOBufferProduce(append_buffer, err));
+      TSIOBufferProduce(append_buffer, err);
     } else {
       break;
     }

Modified: trafficserver/traffic/trunk/example/blacklist-1/blacklist-1.c
URL: http://svn.apache.org/viewvc/trafficserver/traffic/trunk/example/blacklist-1/blacklist-1.c?rev=1071493&r1=1071492&r2=1071493&view=diff
==============================================================================
--- trafficserver/traffic/trunk/example/blacklist-1/blacklist-1.c (original)
+++ trafficserver/traffic/trunk/example/blacklist-1/blacklist-1.c Thu Feb 17 03:13:04 2011
@@ -75,7 +75,6 @@ handle_dns(TSHttpTxn txnp, TSCont contp)
   int i;
   int host_length;
   int lock;
-  TSReturnCode ret_code;
 
   if (TSHttpTxnClientReqGet(txnp, &bufp, &hdr_loc) != TS_SUCCESS) {
     TSError("couldn't retrieve client request header\n");
@@ -99,14 +98,7 @@ handle_dns(TSHttpTxn txnp, TSCont contp)
   /* We need to lock the sites_mutex as that is the mutex that is
      protecting the global list of all blacklisted sites. */
 
-  ret_code = TSMutexLockTry(sites_mutex, &lock);
-
-  if (ret_code == TS_ERROR) {
-    TSError("Error while locking mutex. Cannot check URL against list. Allowing Site....");
-    TSHttpTxnReenable(txnp, TS_EVENT_HTTP_CONTINUE);
-    return;
-  }
-
+  TSMutexLockTry(sites_mutex, &lock);
   if (!lock) {
     TSDebug("blacklist-1", "Unable to get lock. Will retry after some time");
     TSHandleMLocRelease(bufp, hdr_loc, url_loc);
@@ -191,17 +183,11 @@ read_blacklist(TSCont contp)
   char blacklist_file[1024];
   TSFile file;
   int lock;
-  TSReturnCode ret_code;
 
   sprintf(blacklist_file, "%s/blacklist.txt", TSPluginDirGet());
   file = TSfopen(blacklist_file, "r");
 
-  ret_code = TSMutexLockTry(sites_mutex, &lock);
-
-  if (ret_code == TS_ERROR) {
-    TSError("Failed to lock mutex. Cannot read new blacklist file. Exiting ...\n");
-    return;
-  }
+  TSMutexLockTry(sites_mutex, &lock);
   nsites = 0;
 
   /* If the Mutext lock is not successful try again in RETRY_TIME */

Modified: trafficserver/traffic/trunk/example/bnull-transform/bnull-transform.c
URL: http://svn.apache.org/viewvc/trafficserver/traffic/trunk/example/bnull-transform/bnull-transform.c?rev=1071493&r1=1071492&r2=1071493&view=diff
==============================================================================
--- trafficserver/traffic/trunk/example/bnull-transform/bnull-transform.c (original)
+++ trafficserver/traffic/trunk/example/bnull-transform/bnull-transform.c Thu Feb 17 03:13:04 2011
@@ -130,18 +130,11 @@ handle_buffering(TSCont contp, MyData * 
 
       /* Tell the read buffer that we have read the data and are no
          longer interested in it. */
-      if (TSIOBufferReaderConsume(TSVIOReaderGet(write_vio), towrite) == TS_ERROR) {
-        TSError("[bnull-transform] Unable to copy read buffer\n");
-        goto Lerror;
-      }
+      TSIOBufferReaderConsume(TSVIOReaderGet(write_vio), towrite);
 
       /* Modify the write VIO to reflect how much data we've
          completed. */
-      if (TSVIONDoneSet(write_vio, TSVIONDoneGet(write_vio)
-                         + towrite) == TS_ERROR) {
-        TSError("[bnull-transform] Unable to copy read buffer\n");
-        goto Lerror;
-      }
+      TSVIONDoneSet(write_vio, TSVIONDoneGet(write_vio) + towrite);
     }
   }
 

Modified: trafficserver/traffic/trunk/example/cache_scan/cache_scan.cc
URL: http://svn.apache.org/viewvc/trafficserver/traffic/trunk/example/cache_scan/cache_scan.cc?rev=1071493&r1=1071492&r2=1071493&view=diff
==============================================================================
--- trafficserver/traffic/trunk/example/cache_scan/cache_scan.cc (original)
+++ trafficserver/traffic/trunk/example/cache_scan/cache_scan.cc Thu Feb 17 03:13:04 2011
@@ -229,9 +229,7 @@ cleanup(TSCont contp)
       TSVConnShutdown(cstate->net_vc, 1, 1);
 
     if (cstate->req_buffer) {
-      if (TSIOBufferDestroy(cstate->req_buffer) == TS_ERROR) {
-        TSError("failed to destroy req_buffer");
-      }
+      TSIOBufferDestroy(cstate->req_buffer);
       cstate->req_buffer = NULL;
     }
 
@@ -243,9 +241,7 @@ cleanup(TSCont contp)
     }
 
     if (cstate->resp_buffer) {
-      if (TSIOBufferDestroy(cstate->resp_buffer) == TS_ERROR) {
-        TSError("failed to destroy resp_buffer");
-      }
+      TSIOBufferDestroy(cstate->resp_buffer);
       cstate->resp_buffer = NULL;
     }
 

Modified: trafficserver/traffic/trunk/example/gzip-transform/gunzip.c
URL: http://svn.apache.org/viewvc/trafficserver/traffic/trunk/example/gzip-transform/gunzip.c?rev=1071493&r1=1071492&r2=1071493&view=diff
==============================================================================
--- trafficserver/traffic/trunk/example/gzip-transform/gunzip.c (original)
+++ trafficserver/traffic/trunk/example/gzip-transform/gunzip.c Thu Feb 17 03:13:04 2011
@@ -137,9 +137,8 @@ gzip_data_destroy(GzipData * data)
       TSError("gunzip-transform: ERROR: inflateEnd (%d)!", err);
     }
 
-    if (data->output_buffer) {
+    if (data->output_buffer)
       TSIOBufferDestroy(data->output_buffer);
-    }
     TSfree(data);
   }
 }

Modified: trafficserver/traffic/trunk/example/gzip-transform/gzip.c
URL: http://svn.apache.org/viewvc/trafficserver/traffic/trunk/example/gzip-transform/gzip.c?rev=1071493&r1=1071492&r2=1071493&view=diff
==============================================================================
--- trafficserver/traffic/trunk/example/gzip-transform/gzip.c (original)
+++ trafficserver/traffic/trunk/example/gzip-transform/gzip.c Thu Feb 17 03:13:04 2011
@@ -151,9 +151,8 @@ gzip_data_destroy(GzipData * data)
       TSError("gzip-transform: ERROR: deflateEnd (%d)!", err);
     }
 
-    if (data->output_buffer) {
+    if (data->output_buffer)
       TSIOBufferDestroy(data->output_buffer);
-    }
     TSfree(data);
   }
 }

Modified: trafficserver/traffic/trunk/example/null-transform/null-transform.c
URL: http://svn.apache.org/viewvc/trafficserver/traffic/trunk/example/null-transform/null-transform.c?rev=1071493&r1=1071492&r2=1071493&view=diff
==============================================================================
--- trafficserver/traffic/trunk/example/null-transform/null-transform.c (original)
+++ trafficserver/traffic/trunk/example/null-transform/null-transform.c Thu Feb 17 03:13:04 2011
@@ -65,9 +65,8 @@ static void
 my_data_destroy(MyData * data)
 {
   if (data) {
-    if (data->output_buffer) {
-      TSAssert(TSIOBufferDestroy(data->output_buffer) == TS_SUCCESS);
-    }
+    if (data->output_buffer)
+      TSIOBufferDestroy(data->output_buffer);
     TSfree(data);
   }
 }
@@ -128,15 +127,8 @@ handle_transform(TSCont contp)
       goto Lerror;
     }
   } else {
-    if (TSVIONBytesSet(data->output_vio, TSVIONDoneGet(input_vio)) == TS_ERROR) {
-      TSError("[null-transform] error seting output VIO nbytes\n");
-      goto Lerror;
-    }
-
-    if (TSVIOReenable(data->output_vio) == TS_ERROR) {
-      TSError("[null-transform] error reenabling output VIO\n");
-      goto Lerror;
-    }
+    TSVIONBytesSet(data->output_vio, TSVIONDoneGet(input_vio));
+    TSVIOReenable(data->output_vio);
 
     return;
   }
@@ -168,18 +160,12 @@ handle_transform(TSCont contp)
       /* Tell the read buffer that we have read the data and are no
        * longer interested in it.
        */
-      if (TSIOBufferReaderConsume(TSVIOReaderGet(input_vio), towrite) == TS_ERROR) {
-        TSError("[null-plugin] unable to update VIO reader\n");
-        goto Lerror;
-      }
+      TSIOBufferReaderConsume(TSVIOReaderGet(input_vio), towrite);
 
       /* Modify the input VIO to reflect how much data we've
        * completed.
        */
-      if (TSVIONDoneSet(input_vio, TSVIONDoneGet(input_vio) + towrite) == TS_ERROR) {
-        TSError("[null-plugin] unable to update VIO\n");
-        goto Lerror;
-      }
+      TSVIONDoneSet(input_vio, TSVIONDoneGet(input_vio) + towrite);
     }
   } else if (towrite == TS_ERROR) {
     TSError("[null-plugin] error fetching VIO to-do amount\n");
@@ -196,10 +182,8 @@ handle_transform(TSCont contp)
        * the output connection and allow it to consume data from the
        * output buffer.
        */
-      if (TSVIOReenable(data->output_vio) == TS_ERROR) {
-        TSError("[null-plugin] error reenabling transaction\n");
-        goto Lerror;
-      }
+      TSVIOReenable(data->output_vio);
+
       /* Call back the input VIO continuation to let it know that we
        * are ready for more data.
        */
@@ -213,10 +197,7 @@ handle_transform(TSCont contp)
      * that it can consume the data we just gave it.
      */
     TSVIONBytesSet(data->output_vio, TSVIONDoneGet(input_vio));
-    if (TSVIOReenable(data->output_vio) == TS_ERROR) {
-      TSError("[null-plugin] error reenabling transaction\n");
-      goto Lerror;
-    }
+    TSVIOReenable(data->output_vio);
 
     /* Call back the input VIO continuation to let it know that we
      * have completed the write operation.

Modified: trafficserver/traffic/trunk/example/output-header/output-header.c
URL: http://svn.apache.org/viewvc/trafficserver/traffic/trunk/example/output-header/output-header.c?rev=1071493&r1=1071492&r2=1071493&view=diff
==============================================================================
--- trafficserver/traffic/trunk/example/output-header/output-header.c (original)
+++ trafficserver/traffic/trunk/example/output-header/output-header.c Thu Feb 17 03:13:04 2011
@@ -152,10 +152,7 @@ handle_dns(TSHttpTxn txnp, TSCont contp)
     output_len += block_avail;
 
     /* Consume the data so that we get to the next block */
-    if (TSIOBufferReaderConsume(reader, block_avail) == TS_ERROR) {
-      TSDebug(DEBUG_TAG, "error consuming data from the ReaderBlock");
-      TSError("error consuming data from the ReaderBlock\n");
-    }
+    TSIOBufferReaderConsume(reader, block_avail);
 
     /* Get the next block now that we've consumed the
        data off the last block */
@@ -174,15 +171,8 @@ handle_dns(TSHttpTxn txnp, TSCont contp)
   output_len++;
 
   /* Free up the TSIOBuffer that we used to print out the header */
-  if (TSIOBufferReaderFree(reader) != TS_SUCCESS) {
-    TSDebug(DEBUG_TAG, "non-fatal: error releasing IOBufferReader");
-    TSError("non-fatal: error releasing IOBufferReader\n");
-  }
-
-  if (TSIOBufferDestroy(output_buffer) != TS_SUCCESS) {
-    TSDebug(DEBUG_TAG, "non-fatal: error destroying IOBuffer");
-    TSError("non-fatal: error destroying IOBuffer\n");
-  }
+  TSIOBufferReaderFree(reader);
+  TSIOBufferDestroy(output_buffer);
 
   /* Although I'd never do this a production plugin, printf
      the header so that we can see it's all there */

Modified: trafficserver/traffic/trunk/example/protocol/Protocol.c
URL: http://svn.apache.org/viewvc/trafficserver/traffic/trunk/example/protocol/Protocol.c?rev=1071493&r1=1071492&r2=1071493&view=diff
==============================================================================
--- trafficserver/traffic/trunk/example/protocol/Protocol.c (original)
+++ trafficserver/traffic/trunk/example/protocol/Protocol.c Thu Feb 17 03:13:04 2011
@@ -55,10 +55,9 @@ accept_handler(TSCont contp, TSEvent eve
 
     /* This is no reason for not grabbing the lock.
        So skip the routine which handle LockTry failure case. */
-    if (TSMutexLockTry(pmutex, &lock) == TS_SUCCESS) {
-      TSContCall(txn_sm, 0, NULL);
-      TSMutexUnlock(pmutex);
-    }
+    TSMutexLockTry(pmutex, &lock);
+    TSContCall(txn_sm, 0, NULL);
+    TSMutexUnlock(pmutex);
     break;
 
   default:

Modified: trafficserver/traffic/trunk/example/server-transform/server-transform.c
URL: http://svn.apache.org/viewvc/trafficserver/traffic/trunk/example/server-transform/server-transform.c?rev=1071493&r1=1071492&r2=1071493&view=diff
==============================================================================
--- trafficserver/traffic/trunk/example/server-transform/server-transform.c (original)
+++ trafficserver/traffic/trunk/example/server-transform/server-transform.c Thu Feb 17 03:13:04 2011
@@ -149,17 +149,11 @@ transform_destroy(TSCont contp)
 
   data = TSContDataGet(contp);
   if ((data != TS_ERROR_PTR) || (data != NULL)) {
-    if (data->input_buf) {
-      if (TSIOBufferDestroy(data->input_buf) != TS_SUCCESS) {
-        TSError("Unable to destroy input IO buffer");
-      }
-    }
+    if (data->input_buf)
+      TSIOBufferDestroy(data->input_buf);
 
-    if (data->output_buf) {
-      if (TSIOBufferDestroy(data->output_buf) != TS_SUCCESS) {
-        TSError("Unable to destroy output IO buffer");
-      }
-    }
+    if (data->output_buf)
+      TSIOBufferDestroy(data->output_buf);
 
     if (data->pending_action)
       TSActionCancel(data->pending_action);
@@ -206,42 +200,26 @@ transform_connect(TSCont contp, Transfor
 
           if (TSIOBufferWrite(temp, (const char *) &data->content_length, sizeof(int)) == TS_ERROR) {
             TSError("TSIOBufferWrite returns TS_ERROR");
-            if (TSIOBufferReaderFree(tempReader) == TS_ERROR) {
-              TSError("TSIOBufferReaderFree returns TS_ERROR");
-            }
-            if (TSIOBufferDestroy(temp) == TS_ERROR) {
-              TSError("TSIOBufferDestroy returns TS_ERROR");
-            }
+            TSIOBufferReaderFree(tempReader);
+            TSIOBufferDestroy(temp);
             return 0;
           }
 
           if (TSIOBufferCopy(temp, data->input_reader, data->content_length, 0) == TS_ERROR) {
             TSError("TSIOBufferCopy returns TS_ERROR");
-            if (TSIOBufferReaderFree(tempReader) == TS_ERROR) {
-              TSError("TSIOBufferReaderFree returns TS_ERROR");
-            }
-            if (TSIOBufferDestroy(temp) == TS_ERROR) {
-              TSError("TSIOBufferDestroy returns TS_ERROR");
-            }
+            TSIOBufferReaderFree(tempReader);
+            TSIOBufferDestroy(temp);
             return 0;
           }
 
-          if (TSIOBufferReaderFree(data->input_reader) == TS_ERROR) {
-            TSError("Unable to free IOBuffer Reader");
-          }
-
-          if (TSIOBufferDestroy(data->input_buf) == TS_ERROR) {
-            TSError("Trying to destroy IOBuffer returns TS_ERROR");
-          }
-
+          TSIOBufferReaderFree(data->input_reader);
+          TSIOBufferDestroy(data->input_buf);
           data->input_buf = temp;
           data->input_reader = tempReader;
 
         } else {
           TSError("Unable to allocate a reader for buffer");
-          if (TSIOBufferDestroy(temp) == TS_ERROR) {
-            TSError("Unable to destroy IOBuffer");
-          }
+          TSIOBufferDestroy(temp);
           return 0;
         }
       } else {
@@ -315,9 +293,7 @@ transform_read(TSCont contp, TransformDa
 {
   data->state = STATE_READ;
 
-  if (TSIOBufferDestroy(data->input_buf) != TS_SUCCESS) {
-    TSError("Unable to destroy input IO Buffer. TSIOBuffer doesn't return TS_SUCCESS");
-  }
+  TSIOBufferDestroy(data->input_buf);
   data->input_buf = NULL;
   data->input_reader = NULL;
 
@@ -353,17 +329,12 @@ transform_bypass(TSCont contp, Transform
   }
 
   if (data->output_buf) {
-    if (TSIOBufferDestroy(data->output_buf) != TS_SUCCESS) {
-      TSError("Error in destroy output IO buffer. TSIOBufferDestroy doesn't return TS_SUCCESS");
-    }
+    TSIOBufferDestroy(data->output_buf);
     data->output_buf = NULL;
     data->output_reader = NULL;
   }
 
-  if (TSIOBufferReaderConsume(data->input_reader, sizeof(int)) != TS_SUCCESS) {
-    TSError("Error in Consuming bytes from Reader. TSIObufferReaderConsume doesn't return TS_SUCCESS");
-  }
-
+  TSIOBufferReaderConsume(data->input_reader, sizeof(int));
   data->output_vc = TSTransformOutputVConnGet((TSVConn) contp);
   if ((data->output_vc == TS_ERROR_PTR) || (data->output_vc == NULL)) {
     TSError("TSTransformOutputVConnGet returns NULL or TS_ERROR_PTR");
@@ -435,15 +406,11 @@ transform_buffer_event(TSCont contp, Tra
 
           /* Tell the read buffer that we have read the data and are no
              longer interested in it. */
-          if (TSIOBufferReaderConsume(TSVIOReaderGet(write_vio), towrite) != TS_SUCCESS) {
-            TSError("Unable to consume bytes from the buffer");
-          }
+          TSIOBufferReaderConsume(TSVIOReaderGet(write_vio), towrite);
 
           /* Modify the write VIO to reflect how much data we've
              completed. */
-          if (TSVIONDoneSet(write_vio, TSVIONDoneGet(write_vio) + towrite) != TS_SUCCESS) {
-            TSError("Unable to modify the write VIO to reflect how much data we have completed");
-          }
+          TSVIONDoneSet(write_vio, TSVIONDoneGet(write_vio) + towrite);
         }
       }
     }
@@ -495,9 +462,7 @@ transform_write_event(TSCont contp, Tran
 {
   switch (event) {
   case TS_EVENT_VCONN_WRITE_READY:
-    if (TSVIOReenable(data->server_vio) != TS_SUCCESS) {
-      TSError("Unable to reenable the server vio in TS_EVENT_VCONN_WRITE_READY");
-    }
+    TSVIOReenable(data->server_vio);
     break;
   case TS_EVENT_VCONN_WRITE_COMPLETE:
     return transform_read_status(contp, data);
@@ -537,13 +502,10 @@ transform_read_status_event(TSCont contp
             read_ndone = (avail >= read_nbytes) ? read_nbytes : avail;
             memcpy(buf_ptr, buf, read_ndone);
             if (read_ndone > 0) {
-              if (TSIOBufferReaderConsume(data->output_reader, read_ndone) != TS_SUCCESS) {
-                TSError("Error in consuming data from the buffer");
-              } else {
-                read_nbytes -= read_ndone;
-                /* move ptr frwd by read_ndone bytes */
-                buf_ptr = (char *) buf_ptr + read_ndone;
-              }
+              TSIOBufferReaderConsume(data->output_reader, read_ndone);
+              read_nbytes -= read_ndone;
+              /* move ptr frwd by read_ndone bytes */
+              buf_ptr = (char *) buf_ptr + read_ndone;
             }
           } else {
             TSError("TSIOBufferBlockReadStart returns TS_ERROR_PTR");
@@ -588,22 +550,16 @@ transform_read_event(TSCont contp, Trans
     data->server_vc = NULL;
     data->server_vio = NULL;
 
-    if (TSVIOReenable(data->output_vio) != TS_SUCCESS) {
-      TSError("TSVIOReneable doesn't return TS_SUCCESS on TS_EVENT_VCONN_READ_COMPLETE");
-    }
+    TSVIOReenable(data->output_vio);
     break;
   case TS_EVENT_VCONN_READ_READY:
-    if (TSVIOReenable(data->output_vio) != TS_SUCCESS) {
-      TSError("TSVIOReneable doesn't return TS_SUCCESS on TS_EVENT_VCONN_READ_READY");
-    }
+    TSVIOReenable(data->output_vio);
     break;
   case TS_EVENT_VCONN_WRITE_COMPLETE:
     TSVConnShutdown(data->output_vc, 0, 1);
     break;
   case TS_EVENT_VCONN_WRITE_READY:
-    if (TSVIOReenable(data->server_vio) != TS_SUCCESS) {
-      TSError("TSVIOReneable doesn't return TS_SUCCESS while reenabling on TS_EVENT_VCONN_WRITE_READY");
-    }
+    TSVIOReenable(data->server_vio);
     break;
   default:
     break;
@@ -621,9 +577,7 @@ transform_bypass_event(TSCont contp, Tra
     break;
   case TS_EVENT_VCONN_WRITE_READY:
   default:
-    if (TSVIOReenable(data->output_vio) != TS_SUCCESS) {
-      TSError("Error in re-enabling the VIO while bypassing the event");
-    }
+    TSVIOReenable(data->output_vio);
     break;
   }
 

Modified: trafficserver/traffic/trunk/example/thread-pool/psi.c
URL: http://svn.apache.org/viewvc/trafficserver/traffic/trunk/example/thread-pool/psi.c?rev=1071493&r1=1071492&r2=1071493&view=diff
==============================================================================
--- trafficserver/traffic/trunk/example/thread-pool/psi.c (original)
+++ trafficserver/traffic/trunk/example/thread-pool/psi.c Thu Feb 17 03:13:04 2011
@@ -513,16 +513,10 @@ psi_include(TSCont contp, void *edata)
   TSFile filep;
   char buf[BUFFER_SIZE];
   char inc_file[PSI_PATH_MAX_SIZE + PSI_FILENAME_MAX_SIZE];
-  TSReturnCode retval;
 
   /* We manipulate plugin continuation data from a separate thread.
      Grab mutex to avoid concurrent access */
-  retval = TSMutexLock(TSContMutexGet(contp));
-  if (retval != TS_SUCCESS) {
-    TSError("[psi_include] Could not lock mutex");
-    return 0;
-  }
-
+  TSMutexLock(TSContMutexGet(contp));
   data = TSContDataGet(contp);
   TSAssert(data->magic == MAGIC_ALIVE);
 
@@ -568,11 +562,7 @@ psi_include(TSCont contp, void *edata)
         towrite = MIN(ntodo, avail);
 
         memcpy(ptr_block, buf + ndone, towrite);
-        retval = TSIOBufferProduce(data->psi_buffer, towrite);
-        if (retval == TS_ERROR) {
-          TSError("[psi_include] Could not produce data");
-          goto error;
-        }
+        TSIOBufferProduce(data->psi_buffer, towrite);
         ntodo -= towrite;
         ndone += towrite;
       }
@@ -623,7 +613,6 @@ wake_up_streams(TSCont contp)
   TSVIO input_vio;
   ContData *data;
   int ntodo;
-  TSReturnCode retval;
 
   data = TSContDataGet(contp);
   TSAssert(data->magic == MAGIC_ALIVE);
@@ -636,24 +625,12 @@ wake_up_streams(TSCont contp)
   }
 
   if (ntodo > 0) {
-    retval = TSVIOReenable(data->output_vio);
-    if (retval == TS_ERROR) {
-      TSError("[wake_up_streams] Error while reenabling downstream vio");
-      return 0;
-    }
+    TSVIOReenable(data->output_vio);
     TSContCall(TSVIOContGet(input_vio), TS_EVENT_VCONN_WRITE_READY, input_vio);
   } else {
     TSDebug(DBG_TAG, "Total bytes produced by transform = %d", data->transform_bytes);
-    retval = TSVIONBytesSet(data->output_vio, data->transform_bytes);
-    if (retval == TS_ERROR) {
-      TSError("[wake_up_streams] Error while setting nbytes to downstream vio");
-      return 0;
-    }
-    retval = TSVIOReenable(data->output_vio);
-    if (retval == TS_ERROR) {
-      TSError("[wake_up_streams] Error while reenabling downstream vio");
-      return 0;
-    }
+    TSVIONBytesSet(data->output_vio, data->transform_bytes);
+    TSVIOReenable(data->output_vio);
     TSContCall(TSVIOContGet(input_vio), TS_EVENT_VCONN_WRITE_COMPLETE, input_vio);
   }
 
@@ -755,27 +732,15 @@ handle_transform(TSCont contp)
         }
 
         /* Reenable the output connection so it can read the data we've produced. */
-        retval = TSVIOReenable(data->output_vio);
-        if (retval == TS_ERROR) {
-          TSError("[handle_transform] Error while reenabling output VC");
-          return 0;
-        }
+        TSVIOReenable(data->output_vio);
       }
 
       if (toconsume > 0) {
         /* Consume data we've processed an we are no longer interested in */
-        retval = TSIOBufferReaderConsume(input_reader, toconsume);
-        if (retval == TS_ERROR) {
-          TSError("[handle_transform] Error while consuming data from upstream VC");
-          return 0;
-        }
+        TSIOBufferReaderConsume(input_reader, toconsume);
 
         /* Modify the input VIO to reflect how much data we've completed. */
-        retval = TSVIONDoneSet(input_vio, TSVIONDoneGet(input_vio) + toconsume);
-        if (retval == TS_ERROR) {
-          TSError("[handle_transform] Error while setting ndone on upstream VC");
-          return 0;
-        }
+        TSVIONDoneSet(input_vio, TSVIONDoneGet(input_vio) + toconsume);
       }
 
       /* Did we find a psi filename to execute in the data ? */
@@ -847,18 +812,10 @@ dump_psi(TSCont contp)
       }
 
       /* Consume all the output data */
-      retval = TSIOBufferReaderConsume(data->psi_reader, psi_output_len);
-      if (retval == TS_ERROR) {
-        TSError("[dump_psi] Error while consuming data from buffer");
-        return 1;
-      }
+      TSIOBufferReaderConsume(data->psi_reader, psi_output_len);
 
       /* Reenable the output connection so it can read the data we've produced. */
-      retval = TSVIOReenable(data->output_vio);
-      if (retval == TS_ERROR) {
-        TSError("[dump_psi] Error while reenabling output VIO");
-        return 1;
-      }
+      TSVIOReenable(data->output_vio);
     }
   }
 

Modified: trafficserver/traffic/trunk/proxy/InkAPITest.cc
URL: http://svn.apache.org/viewvc/trafficserver/traffic/trunk/proxy/InkAPITest.cc?rev=1071493&r1=1071492&r2=1071493&view=diff
==============================================================================
--- trafficserver/traffic/trunk/proxy/InkAPITest.cc (original)
+++ trafficserver/traffic/trunk/proxy/InkAPITest.cc Thu Feb 17 03:13:04 2011
@@ -1312,12 +1312,10 @@ REGRESSION_TEST(SDK_API_TSContCreate) (R
   int lock = 0;
 
   TSMutexLockTry(mutexp, &lock);
-  if (lock)     //mutex is grabbed
-  {
+  if (lock) {     //mutex is grabbed
     TSContCall(contp, (TSEvent) 0, NULL);
     TSMutexUnlock(mutexp);
-  } else                        //mutex has problems
-  {
+  } else {                       //mutex has problems
     SDK_RPRINT(SDK_ContCreate_test, "TSContCreate", "TestCase1", TC_FAIL, "continuation creation has problems");
     SDK_RPRINT(SDK_ContCreate_test, "TSContCall", "TestCase1", TC_FAIL, "continuation has problems");
 
@@ -1548,9 +1546,7 @@ REGRESSION_TEST(SDK_API_TSIOBufferCreate
   TSIOBuffer bufp = TSIOBufferCreate();
 
   TSIOBufferWaterMarkSet(bufp, watermark);
-
-  watermark = 0;
-  TSIOBufferWaterMarkGet(bufp, &watermark);
+  watermark = TSIOBufferWaterMarkGet(bufp);
 
   if (watermark == 1000) {
     SDK_RPRINT(test, "TSIOBufferCreate", "TestCase1", TC_PASS, "ok");
@@ -2740,9 +2736,9 @@ test_url_print(TSMBuffer bufp, TSMLoc hd
 REGRESSION_TEST(SDK_API_TSUrl) (RegressionTest * test, int atype, int *pstatus)
 {
   NOWARN_UNUSED(atype);
-  TSMBuffer bufp1 = (TSMBuffer) TS_ERROR_PTR;
-  TSMBuffer bufp2 = (TSMBuffer) TS_ERROR_PTR;
-  TSMBuffer bufp3 = (TSMBuffer) TS_ERROR_PTR;
+  TSMBuffer bufp1 = (TSMBuffer)NULL;
+  TSMBuffer bufp2 = (TSMBuffer)NULL;
+  TSMBuffer bufp3 = (TSMBuffer)NULL;
   TSMLoc url_loc1;
   TSMLoc url_loc2;
   TSMLoc url_loc3;
@@ -2766,10 +2762,10 @@ REGRESSION_TEST(SDK_API_TSUrl) (Regressi
   const char *fragment = "yyy";
   const char *fragment_get;
   char *url_expected_string;
-  char *url_string_from_1 = (char *) TS_ERROR_PTR;
-  char *url_string_from_2 = (char *) TS_ERROR_PTR;
-  char *url_string_from_3 = (char *) TS_ERROR_PTR;
-  char *url_string_from_print = (char *) TS_ERROR_PTR;
+  char *url_string_from_1 = (char *)NULL;
+  char *url_string_from_2 = (char *)NULL;
+  char *url_string_from_3 = (char *)NULL;
+  char *url_string_from_print = (char *)NULL;
   int url_expected_length;
   int url_length_from_1;
   int url_length_from_2;
@@ -3027,13 +3023,9 @@ REGRESSION_TEST(SDK_API_TSUrl) (Regressi
   }
 
   //Clone
-  if ((bufp3 = TSMBufferCreate()) == TS_ERROR_PTR) {
-    // Cannot proceed with tests.
-    SDK_RPRINT(test, "TSMBufferCreate", "TestCase2", TC_FAIL, "unable to allocate MBuffer for TSUrlClone.");
-    goto print_results;
-  };
+  bufp3 = TSMBufferCreate();
   if (TSUrlClone(bufp3, bufp1, url_loc1, &url_loc3) != TS_SUCCESS) {
-    SDK_RPRINT(test, "TSUrlClone", "TestCase1", TC_FAIL, "Returned TS_ERROR_PTR");
+    SDK_RPRINT(test, "TSUrlClone", "TestCase1", TC_FAIL, "Returned TS_ERROR");
   } else {
     //String Test Case 2
     url_string_from_3 = TSUrlStringGet(bufp3, url_loc3, NULL);
@@ -3092,22 +3084,22 @@ REGRESSION_TEST(SDK_API_TSUrl) (Regressi
 
 print_results:
   TSfree(url_expected_string);
-  if (url_string_from_1 != TS_ERROR_PTR) {
+  if (url_string_from_1 != NULL) {
     TSfree(url_string_from_1);
   }
-  if (url_string_from_2 != TS_ERROR_PTR) {
+  if (url_string_from_2 != NULL) {
     TSfree(url_string_from_2);
   }
-  if (url_string_from_3 != TS_ERROR_PTR) {
+  if (url_string_from_3 != NULL) {
     TSfree(url_string_from_3);
   }
-  if (bufp1 != TS_ERROR_PTR) {
+  if (bufp1 != NULL) {
     TSMBufferDestroy(bufp1);
   }
-  if (bufp2 != TS_ERROR_PTR) {
+  if (bufp2 != NULL) {
     TSMBufferDestroy(bufp2);
   }
-  if (bufp3 != TS_ERROR_PTR) {
+  if (bufp3 != NULL) {
     TSMBufferDestroy(bufp3);
   }
   if ((test_passed_create == false) ||
@@ -3179,15 +3171,15 @@ print_results:
 REGRESSION_TEST(SDK_API_TSHttpHdr) (RegressionTest * test, int atype, int *pstatus)
 {
   NOWARN_UNUSED(atype);
-  TSMBuffer bufp1 = (TSMBuffer) TS_ERROR_PTR;
-  TSMBuffer bufp2 = (TSMBuffer) TS_ERROR_PTR;
-  TSMBuffer bufp3 = (TSMBuffer) TS_ERROR_PTR;
-  TSMBuffer bufp4 = (TSMBuffer) TS_ERROR_PTR;
-
-  TSMLoc hdr_loc1 = (TSMLoc) TS_ERROR_PTR;
-  TSMLoc hdr_loc2 = (TSMLoc) TS_ERROR_PTR;
-  TSMLoc hdr_loc3 = (TSMLoc) TS_ERROR_PTR;
-  TSMLoc hdr_loc4 = (TSMLoc) TS_ERROR_PTR;
+  TSMBuffer bufp1 = (TSMBuffer)NULL;
+  TSMBuffer bufp2 = (TSMBuffer)NULL;
+  TSMBuffer bufp3 = (TSMBuffer)NULL;
+  TSMBuffer bufp4 = (TSMBuffer)NULL;
+
+  TSMLoc hdr_loc1 = (TSMLoc)NULL;
+  TSMLoc hdr_loc2 = (TSMLoc)NULL;
+  TSMLoc hdr_loc3 = (TSMLoc)NULL;
+  TSMLoc hdr_loc4 = (TSMLoc)NULL;
 
   TSHttpType hdr1type;
   TSHttpType hdr2type;
@@ -3302,13 +3294,13 @@ REGRESSION_TEST(SDK_API_TSHttpHdr) (Regr
   // Url
   if (test_passed_Http_Hdr_Type == true) {
     if (TSUrlCreate(bufp1, &url_loc) != TS_SUCCESS) {
-      SDK_RPRINT(test, "TSHttpHdrUrlSet&Get", "TestCase1", TC_FAIL, "Cannot run test as TSUrlCreate returns TS_ERROR_PTR");
+      SDK_RPRINT(test, "TSHttpHdrUrlSet&Get", "TestCase1", TC_FAIL, "Cannot run test as TSUrlCreate returns TS_ERROR");
     } else {
       if (TSHttpHdrUrlSet(bufp1, hdr_loc1, url_loc) == TS_ERROR) {
         SDK_RPRINT(test, "TSHttpHdrUrlSet&Get", "TestCase1", TC_FAIL, "TSHttpHdrUrlSet returns TS_ERROR");
       } else {
         if (TSHttpHdrUrlGet(bufp1, hdr_loc1, &url_loc_Get) != TS_SUCCESS) {
-          SDK_RPRINT(test, "TSHttpHdrUrlSet&Get", "TestCase1", TC_FAIL, "TSHttpHdrUrlGet retuns TS_ERROR_PTR");
+          SDK_RPRINT(test, "TSHttpHdrUrlSet&Get", "TestCase1", TC_FAIL, "TSHttpHdrUrlGet retuns TS_ERROR");
         } else {
           if (url_loc == url_loc_Get) {
             SDK_RPRINT(test, "TSHttpHdrUrlSet&Get", "TestCase1", TC_PASS, "ok");
@@ -3425,7 +3417,7 @@ REGRESSION_TEST(SDK_API_TSHttpHdr) (Regr
   //Reason Lookup
   if (strcmp("None", TSHttpHdrReasonLookup(TS_HTTP_STATUS_NONE)) != 0) {
     SDK_RPRINT(test, "TSHttpHdrReasonLookup", "TestCase1", TC_FAIL,
-               "TSHttpHdrReasonLookup returns TS_ERROR_PTR or Value's mismatch");
+               "TSHttpHdrReasonLookup returns TS_ERROR or Value's mismatch");
   } else {
     SDK_RPRINT(test, "TSHttpHdrReasonLookup", "TestCase1", TC_PASS, "ok");
     test_passed_Http_Hdr_Reason_Lookup = true;
@@ -3433,7 +3425,7 @@ REGRESSION_TEST(SDK_API_TSHttpHdr) (Regr
 
   if (strcmp("Ok", TSHttpHdrReasonLookup(TS_HTTP_STATUS_OK)) != 0) {
     SDK_RPRINT(test, "TSHttpHdrReasonLookup", "TestCase2", TC_FAIL,
-               "TSHttpHdrReasonLookup returns TS_ERROR_PTR or Value's mismatch");
+               "TSHttpHdrReasonLookup returns TS_ERROR or Value's mismatch");
     if (test_passed_Http_Hdr_Reason_Lookup == true) {
       test_passed_Http_Hdr_Reason_Lookup = false;
     }
@@ -3443,7 +3435,7 @@ REGRESSION_TEST(SDK_API_TSHttpHdr) (Regr
 
   if (strcmp("Continue", TSHttpHdrReasonLookup(TS_HTTP_STATUS_CONTINUE)) != 0) {
     SDK_RPRINT(test, "TSHttpHdrReasonLookup", "TestCase3", TC_FAIL,
-               "TSHttpHdrReasonLookup returns TS_ERROR_PTR or Value's mismatch");
+               "TSHttpHdrReasonLookup returns TS_ERROR or Value's mismatch");
     if (test_passed_Http_Hdr_Reason_Lookup == true) {
       test_passed_Http_Hdr_Reason_Lookup = false;
     }
@@ -3453,7 +3445,7 @@ REGRESSION_TEST(SDK_API_TSHttpHdr) (Regr
 
   if (strcmp("Not Modified", TSHttpHdrReasonLookup(TS_HTTP_STATUS_NOT_MODIFIED)) != 0) {
     SDK_RPRINT(test, "TSHttpHdrReasonLookup", "TestCase2", TC_FAIL,
-               "TSHttpHdrReasonLookup returns TS_ERROR_PTR or Value's mismatch");
+               "TSHttpHdrReasonLookup returns TS_ERROR or Value's mismatch");
     if (test_passed_Http_Hdr_Reason_Lookup == true) {
       test_passed_Http_Hdr_Reason_Lookup = false;
     }
@@ -3594,7 +3586,7 @@ REGRESSION_TEST(SDK_API_TSHttpHdr) (Regr
   // Clone
   if (test_passed_Http_Hdr_Create == true) {
     if (TSHttpHdrClone(bufp4, bufp1, hdr_loc1, &hdr_loc4) != TS_SUCCESS) {
-      SDK_RPRINT(test, "TSHttpHdrClone", "TestCase1", TC_FAIL, "TSHttpHdrClone returns TS_ERROR_PTR");
+      SDK_RPRINT(test, "TSHttpHdrClone", "TestCase1", TC_FAIL, "TSHttpHdrClone returns TS_ERROR");
     } else {
 
       bool flag = true;
@@ -3727,89 +3719,66 @@ REGRESSION_TEST(SDK_API_TSHttpHdr) (Regr
     if ((actual_length = TSHttpHdrLengthGet(bufp1, hdr_loc1)) == TS_ERROR) {
       SDK_RPRINT(test, "TSHttpHdrLengthGet", "TestCase1", TC_FAIL, "TSHttpHdrLengthGet returns TS_ERROR");
     } else {
-      TSIOBuffer iobuf;
-
-      if ((iobuf = TSIOBufferCreate()) == TS_ERROR_PTR) {
-        SDK_RPRINT(test, "TSHttpHdrLengthGet", "TestCase1", TC_FAIL, "Cannot create iobuffer. Cannot continue with test");
+      TSIOBuffer iobuf = TSIOBufferCreate();
+      TSHttpHdrPrint(bufp1, hdr_loc1, iobuf);
+      TSIOBufferReader iobufreader = TSIOBufferReaderAlloc(iobuf);
+      if ((expected_length = TSIOBufferReaderAvail(iobufreader)) == TS_ERROR) {
+        SDK_RPRINT(test, "TSHttpHdrLengthGet", "TestCase1", TC_FAIL, "Cannot calculate the length to be expected.");
       } else {
-        TSHttpHdrPrint(bufp1, hdr_loc1, iobuf);
-        TSIOBufferReader iobufreader;
-        if ((iobufreader = TSIOBufferReaderAlloc(iobuf)) == TS_ERROR_PTR) {
-          SDK_RPRINT(test, "TSHttpHdrLengthGet", "TestCase1", TC_FAIL, "Cannot allocate a reader to io buffer");
+        if (actual_length == expected_length) {
+          SDK_RPRINT(test, "TSHttpHdrLengthGet", "TestCase1", TC_PASS, "ok");
+          test_passed_Http_Hdr_Length = true;
         } else {
-          if ((expected_length = TSIOBufferReaderAvail(iobufreader)) == TS_ERROR) {
-            SDK_RPRINT(test, "TSHttpHdrLengthGet", "TestCase1", TC_FAIL, "Cannot calculate the length to be expected.");
-          } else {
-            if (actual_length == expected_length) {
-              SDK_RPRINT(test, "TSHttpHdrLengthGet", "TestCase1", TC_PASS, "ok");
-              test_passed_Http_Hdr_Length = true;
-            } else {
-              SDK_RPRINT(test, "TSHttpHdrLengthGet", "TestCase1", TC_FAIL, "Incorrect value returned.");
-            }
-          }
+          SDK_RPRINT(test, "TSHttpHdrLengthGet", "TestCase1", TC_FAIL, "Incorrect value returned.");
+        }
+      }
 
-          // Print.
-          if ((test_passed_Http_Hdr_Method == true) && (test_passed_Http_Hdr_Url == true) &&
-              (test_passed_Http_Hdr_Version == true) && (test_passed_Http_Hdr_Length == true) &&
-              (try_print_function == true)) {
-            char *actual_iobuf = NULL;
+      // Print.
+      if ((test_passed_Http_Hdr_Method == true) && (test_passed_Http_Hdr_Url == true) &&
+          (test_passed_Http_Hdr_Version == true) && (test_passed_Http_Hdr_Length == true) &&
+          (try_print_function == true)) {
+        char *actual_iobuf = NULL;
 
-            actual_iobuf = (char *) TSmalloc((actual_length + 1) * sizeof(char));
+        actual_iobuf = (char *) TSmalloc((actual_length + 1) * sizeof(char));
 
-            if (actual_iobuf == NULL) {
-              SDK_RPRINT(test, "TSHttpHdrPrint", "TestCase1", TC_FAIL, "Unable to allocate memory");
-            } else {
+        if (actual_iobuf == NULL) {
+          SDK_RPRINT(test, "TSHttpHdrPrint", "TestCase1", TC_FAIL, "Unable to allocate memory");
+        } else {
 
-              TSIOBufferBlock iobufblock;
-              int64_t bytes_read;
+          TSIOBufferBlock iobufblock;
+          int64_t bytes_read;
 
-              memset(actual_iobuf, 0, (actual_length + 1) * sizeof(char));
-              bytes_read = 0;
+          memset(actual_iobuf, 0, (actual_length + 1) * sizeof(char));
+          bytes_read = 0;
 
-              iobufblock = TSIOBufferReaderStart(iobufreader);
+          iobufblock = TSIOBufferReaderStart(iobufreader);
 
-              while ((iobufblock != NULL) && (iobufblock != TS_ERROR_PTR)) {
-                const char *block_start;
-                int64_t block_size;
-                block_start = TSIOBufferBlockReadStart(iobufblock, iobufreader, &block_size);
-
-                if ((block_start == TS_ERROR_PTR) || (block_size == 0) || (block_size == TS_ERROR)) {
-                  break;
-                }
-
-                memcpy(actual_iobuf + bytes_read, block_start, block_size);
-                bytes_read += block_size;
-
-                /*
-                   if (TSIOBufferReaderConsume(iobufreader,block_size)==TS_ERROR) {
-                   break;
-                   }
-                 */
-                TSIOBufferReaderConsume(iobufreader, block_size);
-                iobufblock = TSIOBufferReaderStart(iobufreader);
-              }
-              if (strcmp(actual_iobuf, expected_iobuf) == 0) {
-                SDK_RPRINT(test, "TSHttpHdrPrint", "TestCase1", TC_PASS, "ok");
-                test_passed_Http_Hdr_Print = true;
-              } else {
-                SDK_RPRINT(test, "TSHttpHdrPrint", "TestCase1", TC_FAIL, "Value's mismatch");
-              }
+          while (iobufblock != NULL) {
+            const char *block_start;
+            int64_t block_size;
 
-              TSfree(actual_iobuf);
-              /*
-                 if ((TSIOBufferReaderFree(iobufreader)==TS_ERROR) ||
-                 (TSIOBufferDestroy(iobuf)==TS_ERROR)) {
-                 SDK_RPRINT(test,"TSIOBuffer","",TC_FAIL,"Unable to free memory");
-                 }
-               */
-              TSIOBufferReaderFree(iobufreader);
-              TSIOBufferDestroy(iobuf);
-            }
+            block_start = TSIOBufferBlockReadStart(iobufblock, iobufreader, &block_size);
+            if (block_size <= 0)
+              break;
+
+            memcpy(actual_iobuf + bytes_read, block_start, block_size);
+            bytes_read += block_size;
+            TSIOBufferReaderConsume(iobufreader, block_size);
+            iobufblock = TSIOBufferReaderStart(iobufreader);
+          }
+          if (strcmp(actual_iobuf, expected_iobuf) == 0) {
+            SDK_RPRINT(test, "TSHttpHdrPrint", "TestCase1", TC_PASS, "ok");
+            test_passed_Http_Hdr_Print = true;
           } else {
-            SDK_RPRINT(test, "TSHttpHdrPrint", "TestCase1", TC_FAIL, "Unable to run test for TSHttpHdrPrint");
+            SDK_RPRINT(test, "TSHttpHdrPrint", "TestCase1", TC_FAIL, "Value's mismatch");
           }
 
+          TSfree(actual_iobuf);
+          TSIOBufferReaderFree(iobufreader);
+          TSIOBufferDestroy(iobuf);
         }
+      } else {
+        SDK_RPRINT(test, "TSHttpHdrPrint", "TestCase1", TC_FAIL, "Unable to run test for TSHttpHdrPrint");
       }
     }
   } else {
@@ -3834,25 +3803,25 @@ REGRESSION_TEST(SDK_API_TSHttpHdr) (Regr
     SDK_RPRINT(test, "TSHttpHdrDestroy", "All Test Cases", TC_FAIL, "Cannot run test as header was not created");
   }
 
-  if (bufp1 != TS_ERROR_PTR) {
+  if (bufp1) {
     if (TSMBufferDestroy(bufp1) == TS_ERROR) {
       SDK_RPRINT(test, "TSMBufferDestroy", "TestCase1", TC_FAIL, "Unable to destroy MBuffer");
     }
   }
 
-  if (bufp2 != TS_ERROR_PTR) {
+  if (bufp2) {
     if (TSMBufferDestroy(bufp2) == TS_ERROR) {
       SDK_RPRINT(test, "TSMBufferDestroy", "TestCase2", TC_FAIL, "Unable to destroy MBuffer");
     }
   }
 
-  if (bufp3 != TS_ERROR_PTR) {
+  if (bufp3) {
     if (TSMBufferDestroy(bufp3) == TS_ERROR) {
       SDK_RPRINT(test, "TSMBufferDestroy", "TestCase3", TC_FAIL, "Unable to destroy MBuffer");
     }
   }
 
-  if (bufp4 != TS_ERROR_PTR) {
+  if (bufp4) {
     if (TSMBufferDestroy(bufp4) == TS_ERROR) {
       SDK_RPRINT(test, "TSMBufferDestroy", "TestCase4", TC_FAIL, "Unable to destroy MBuffer");
     }
@@ -3940,15 +3909,15 @@ compare_field_names(RegressionTest * tes
 REGRESSION_TEST(SDK_API_TSMimeHdrField) (RegressionTest * test, int atype, int *pstatus)
 {
   NOWARN_UNUSED(atype);
-  TSMBuffer bufp1 = (TSMBuffer) TS_ERROR_PTR;
+  TSMBuffer bufp1 = (TSMBuffer)NULL;
 
-  TSMLoc mime_loc1 = (TSMLoc) TS_ERROR_PTR;
+  TSMLoc mime_loc1 = (TSMLoc)NULL;
 
-  TSMLoc field_loc11 = (TSMLoc) TS_ERROR_PTR;
-  TSMLoc field_loc12 = (TSMLoc) TS_ERROR_PTR;
-  TSMLoc field_loc13 = (TSMLoc) TS_ERROR_PTR;
-  TSMLoc field_loc14 = (TSMLoc) TS_ERROR_PTR;
-  TSMLoc field_loc15 = (TSMLoc) TS_ERROR_PTR;
+  TSMLoc field_loc11 = (TSMLoc)NULL;
+  TSMLoc field_loc12 = (TSMLoc)NULL;
+  TSMLoc field_loc13 = (TSMLoc)NULL;
+  TSMLoc field_loc14 = (TSMLoc)NULL;
+  TSMLoc field_loc15 = (TSMLoc)NULL;
 
 
   const char *field1Name = "field1";
@@ -3975,11 +3944,11 @@ REGRESSION_TEST(SDK_API_TSMimeHdrField) 
   int field4_length;
   /* int field5_length; unused: lv */
 
-  TSMLoc test_field_loc11 = (TSMLoc) TS_ERROR_PTR;
-  TSMLoc test_field_loc12 = (TSMLoc) TS_ERROR_PTR;
-  TSMLoc test_field_loc13 = (TSMLoc) TS_ERROR_PTR;
-  TSMLoc test_field_loc14 = (TSMLoc) TS_ERROR_PTR;
-  TSMLoc test_field_loc15 = (TSMLoc) TS_ERROR_PTR;
+  TSMLoc test_field_loc11 = (TSMLoc)NULL;
+  TSMLoc test_field_loc12 = (TSMLoc)NULL;
+  TSMLoc test_field_loc13 = (TSMLoc)NULL;
+  TSMLoc test_field_loc14 = (TSMLoc)NULL;
+  TSMLoc test_field_loc15 = (TSMLoc)NULL;
 
   int actualNumberOfFields;
   int numberOfFields;

Modified: trafficserver/traffic/trunk/proxy/InkIOCoreAPI.cc
URL: http://svn.apache.org/viewvc/trafficserver/traffic/trunk/proxy/InkIOCoreAPI.cc?rev=1071493&r1=1071492&r2=1071493&view=diff
==============================================================================
--- trafficserver/traffic/trunk/proxy/InkIOCoreAPI.cc (original)
+++ trafficserver/traffic/trunk/proxy/InkIOCoreAPI.cc Thu Feb 17 03:13:04 2011
@@ -39,6 +39,10 @@
 #include "I_Cache.h"
 #include "I_HostDB.h"
 
+// This assert is for internal API use only.
+#define sdk_assert(EX)                                          \
+  (void)((EX) || (_TSReleaseAssert(#EX, __FILE__, __LINE__)))
+
 TSReturnCode
 sdk_sanity_check_mutex(TSMutex mutex)
 {
@@ -74,13 +78,16 @@ sdk_sanity_check_iocore_structure(void *
   return TS_SUCCESS;
 }
 
+// From InkAPI.cc
+TSReturnCode sdk_sanity_check_continuation(TSCont cont);
+TSReturnCode sdk_sanity_check_null_ptr(void *ptr);
+
 
 ////////////////////////////////////////////////////////////////////
 //
 // Threads
 //
 ////////////////////////////////////////////////////////////////////
-
 struct INKThreadInternal:public EThread
 {
 #if !defined (_WIN32)
@@ -124,11 +131,11 @@ TSThreadCreate(TSThreadFunc func, void *
   thread->func = func;
   thread->data = data;
 
-  if (!(ink_thread_create(ink_thread_trampoline, (void *) thread, 1))) {
-    return (TSThread) NULL;
+  if (!(ink_thread_create(ink_thread_trampoline, (void *)thread, 1))) {
+    return (TSThread)NULL;
   }
 
-  return (TSThread) thread;
+  return (TSThread)thread;
 }
 
 TSThread
@@ -140,7 +147,7 @@ TSThreadInit()
 
 #ifdef DEBUG
   if (thread == NULL)
-    return (TSThread) NULL;
+    return (TSThread)NULL;
 #endif
 
   thread->set_specific();
@@ -148,25 +155,19 @@ TSThreadInit()
   return thread;
 }
 
-TSReturnCode
+void
 TSThreadDestroy(TSThread thread)
 {
-  if (sdk_sanity_check_iocore_structure(thread) != TS_SUCCESS)
-    return TS_ERROR;
+  sdk_assert(sdk_sanity_check_iocore_structure(thread) == TS_SUCCESS);
 
-  INKThreadInternal *ithread = (INKThreadInternal *) thread;
+  INKThreadInternal *ithread = (INKThreadInternal *)thread;
   delete ithread;
-  return TS_SUCCESS;
 }
 
 TSThread
 TSThreadSelf(void)
 {
-  TSThread ithread = (TSThread) this_ethread();
-#ifdef DEBUG
-  if (ithread == NULL)
-    return (TSThread) NULL;
-#endif
+  TSThread ithread = (TSThread)this_ethread();
   return ithread;
 }
 
@@ -176,34 +177,38 @@ TSThreadSelf(void)
 // Mutexes
 //
 ////////////////////////////////////////////////////////////////////
-
 TSMutex
 TSMutexCreate()
 {
   ProxyMutex *mutexp = new_ProxyMutex();
-  if (sdk_sanity_check_mutex((TSMutex) mutexp) != TS_SUCCESS)
-    return (TSMutex) TS_ERROR_PTR;
-  return (TSMutex) mutexp;
-//    return (TSMutex*) new_ProxyMutex ();
+
+  // TODO: Remove this when allocations can never fail.
+  sdk_assert(sdk_sanity_check_mutex((TSMutex)mutexp) == TS_SUCCESS);
+
+  return (TSMutex)mutexp;
 }
 
 /* The following two APIs are for Into work, actually, APIs of Mutex
    should allow plugins to manually increase or decrease the refcount
    of the mutex pointer, plugins may want more control of the creation
    and destroy of the mutex.*/
-
 TSMutex
 TSMutexCreateInternal()
 {
   ProxyMutex *new_mutex = new_ProxyMutex();
+
+  // TODO: Remove this when allocations can never fail.
+  sdk_assert(sdk_sanity_check_mutex((TSMutex)new_mutex) == TS_SUCCESS);
+
   new_mutex->refcount_inc();
-  return (TSMutex *) new_mutex;
+  return (TSMutex *)new_mutex;
 }
 
 int
 TSMutexCheck(TSMutex mutex)
 {
-  ProxyMutex *mutexp = (ProxyMutex *) mutex;
+  ProxyMutex *mutexp = (ProxyMutex *)mutex;
+
   if (mutexp->m_refcount < 0)
     return -1;
   if (mutexp->nthread_holding < 0)
@@ -211,150 +216,129 @@ TSMutexCheck(TSMutex mutex)
   return 1;
 }
 
-TSReturnCode
+void
 TSMutexLock(TSMutex mutexp)
 {
-  if (sdk_sanity_check_mutex(mutexp) != TS_SUCCESS)
-    return TS_ERROR;
-
-  MUTEX_TAKE_LOCK((ProxyMutex *) mutexp, this_ethread());
-  return TS_SUCCESS;
+  sdk_assert(sdk_sanity_check_mutex(mutexp) == TS_SUCCESS);
+  MUTEX_TAKE_LOCK((ProxyMutex *)mutexp, this_ethread());
 }
 
 
-TSReturnCode
+void
 TSMutexLockTry(TSMutex mutexp, int *lock)
 {
-  if (sdk_sanity_check_mutex(mutexp) != TS_SUCCESS)
-    return TS_ERROR;
-
-  *lock = MUTEX_TAKE_TRY_LOCK((ProxyMutex *) mutexp, this_ethread());
-  return TS_SUCCESS;
+  sdk_assert(sdk_sanity_check_mutex(mutexp) == TS_SUCCESS);
+  *lock = MUTEX_TAKE_TRY_LOCK((ProxyMutex *)mutexp, this_ethread());
 }
 
-TSReturnCode
+void
 TSMutexUnlock(TSMutex mutexp)
 {
-  if (sdk_sanity_check_mutex(mutexp) != TS_SUCCESS)
-    return TS_ERROR;
-
-  MUTEX_UNTAKE_LOCK((ProxyMutex *) mutexp, this_ethread());
-  return TS_SUCCESS;
+  sdk_assert(sdk_sanity_check_mutex(mutexp) == TS_SUCCESS);
+  MUTEX_UNTAKE_LOCK((ProxyMutex *)mutexp, this_ethread());
 }
 
 /* VIOs */
 
-TSReturnCode
+void
 TSVIOReenable(TSVIO viop)
 {
-  if (sdk_sanity_check_iocore_structure(viop) != TS_SUCCESS)
-    return TS_ERROR;
+  sdk_assert(sdk_sanity_check_iocore_structure(viop) == TS_SUCCESS);
 
-  VIO *vio = (VIO *) viop;
+  VIO *vio = (VIO *)viop;
   vio->reenable();
-  return TS_SUCCESS;
 }
 
 TSIOBuffer
 TSVIOBufferGet(TSVIO viop)
 {
-  if (sdk_sanity_check_iocore_structure(viop) != TS_SUCCESS)
-    return (TSIOBuffer) TS_ERROR_PTR;
+  sdk_assert(sdk_sanity_check_iocore_structure(viop) == TS_SUCCESS);
 
-  VIO *vio = (VIO *) viop;
+  VIO *vio = (VIO *)viop;
   return vio->get_writer();
 }
 
 TSIOBufferReader
 TSVIOReaderGet(TSVIO viop)
 {
-  if (sdk_sanity_check_iocore_structure(viop) != TS_SUCCESS)
-    return (TSIOBufferReader) TS_ERROR_PTR;
+  sdk_assert(sdk_sanity_check_iocore_structure(viop) == TS_SUCCESS);
 
-  VIO *vio = (VIO *) viop;
+  VIO *vio = (VIO *)viop;
   return vio->get_reader();
 }
 
 int64_t
 TSVIONBytesGet(TSVIO viop)
 {
-  if (sdk_sanity_check_iocore_structure(viop) != TS_SUCCESS)
-    return TS_ERROR;
+  sdk_assert(sdk_sanity_check_iocore_structure(viop) == TS_SUCCESS);
 
-  VIO *vio = (VIO *) viop;
+  VIO *vio = (VIO *)viop;
   return vio->nbytes;
 }
 
-TSReturnCode
+void
 TSVIONBytesSet(TSVIO viop, int64_t nbytes)
 {
-  if ((sdk_sanity_check_iocore_structure(viop) != TS_SUCCESS) || nbytes < 0)
-    return TS_ERROR;
+  sdk_assert(sdk_sanity_check_iocore_structure(viop) == TS_SUCCESS);
+  sdk_assert(nbytes >= 0);
 
-  VIO *vio = (VIO *) viop;
+  VIO *vio = (VIO *)viop;
   vio->nbytes = nbytes;
-  return TS_SUCCESS;
 }
 
 int64_t
 TSVIONDoneGet(TSVIO viop)
 {
-  if (sdk_sanity_check_iocore_structure(viop) != TS_SUCCESS)
-    return TS_ERROR;
+  sdk_assert(sdk_sanity_check_iocore_structure(viop) == TS_SUCCESS);
 
-  VIO *vio = (VIO *) viop;
+  VIO *vio = (VIO *)viop;
   return vio->ndone;
 }
 
-TSReturnCode
+void
 TSVIONDoneSet(TSVIO viop, int64_t ndone)
 {
-  if ((sdk_sanity_check_iocore_structure(viop) != TS_SUCCESS) || ndone < 0)
-    return TS_ERROR;
+  sdk_assert(sdk_sanity_check_iocore_structure(viop) == TS_SUCCESS);
+  sdk_assert(ndone >= 0);
 
-  VIO *vio = (VIO *) viop;
+  VIO *vio = (VIO *)viop;
   vio->ndone = ndone;
-  return TS_SUCCESS;
 }
 
 int64_t
 TSVIONTodoGet(TSVIO viop)
 {
-  if (sdk_sanity_check_iocore_structure(viop) != TS_SUCCESS)
-    return TS_ERROR;
+  sdk_assert(sdk_sanity_check_iocore_structure(viop) == TS_SUCCESS);
 
-  VIO *vio = (VIO *) viop;
+  VIO *vio = (VIO *)viop;
   return vio->ntodo();
 }
 
 TSCont
 TSVIOContGet(TSVIO viop)
 {
-  if (sdk_sanity_check_iocore_structure(viop) != TS_SUCCESS)
-    return (TSCont) TS_ERROR_PTR;
+  sdk_assert(sdk_sanity_check_iocore_structure(viop) == TS_SUCCESS);
 
-  VIO *vio = (VIO *) viop;
+  VIO *vio = (VIO *)viop;
   return (TSCont) vio->_cont;
 }
 
 TSVConn
 TSVIOVConnGet(TSVIO viop)
 {
-  if (sdk_sanity_check_iocore_structure(viop) != TS_SUCCESS)
-    return (TSVConn) TS_ERROR_PTR;
+  sdk_assert(sdk_sanity_check_iocore_structure(viop) == TS_SUCCESS);
 
-  VIO *vio = (VIO *) viop;
-  return (TSVConn) vio->vc_server;
+  VIO *vio = (VIO *)viop;
+  return (TSVConn)vio->vc_server;
 }
 
 TSMutex
 TSVIOMutexGet(TSVIO viop)
 {
-  if (sdk_sanity_check_iocore_structure(viop) != TS_SUCCESS)
-    return (TSVConn) TS_ERROR_PTR;
+  sdk_assert(sdk_sanity_check_iocore_structure(viop) == TS_SUCCESS);
 
-  VIO *vio = (VIO *) viop;
-  return (TSMutex) ((ProxyMutex *) vio->mutex);
+  VIO *vio = (VIO *)viop;
+  return (TSMutex)((ProxyMutex *)vio->mutex);
 }
 
 /* High Resolution Time */
@@ -370,16 +354,20 @@ INKBasedTimeGet()
 TSAction
 INKUDPBind(TSCont contp, unsigned int ip, int port)
 {
+  sdk_assert(sdk_sanity_check_continuation(contp) == TS_SUCCESS);
+
   FORCE_PLUGIN_MUTEX(contp);
-  return (udpNet.UDPBind((Continuation *) contp, port, ip, INK_ETHERNET_MTU_SIZE, INK_ETHERNET_MTU_SIZE));
+  return (udpNet.UDPBind((Continuation *)contp, port, ip, INK_ETHERNET_MTU_SIZE, INK_ETHERNET_MTU_SIZE));
 }
 
 TSAction
 INKUDPSendTo(TSCont contp, INKUDPConn udp, unsigned int ip, int port, char *data, int64_t len)
 {
+  sdk_assert(sdk_sanity_check_continuation(contp) == TS_SUCCESS);
+
   FORCE_PLUGIN_MUTEX(contp);
   UDPPacket *packet = new_UDPPacket();
-  UDPConnection *conn = (UDPConnection *) udp;
+  UDPConnection *conn = (UDPConnection *)udp;
 
   packet->to.sin_family = PF_INET;
   packet->to.sin_port = htons(port);
@@ -395,28 +383,30 @@ INKUDPSendTo(TSCont contp, INKUDPConn ud
   memcpy(blockp->start(), data, len);
   blockp->fill(len);
 
-  packet->append_block((IOBufferBlock *) blockp);
+  packet->append_block((IOBufferBlock *)blockp);
   /* (Jinsheng 11/27/00) set connection twice which causes:
      FATAL: ../../../proxy/iocore/UDPPacket.h:136:
      failed assert `!m_conn` */
 
   /* packet->setConnection ((UDPConnection *)udp); */
-  return conn->send((Continuation *) contp, packet);
+  return conn->send((Continuation *)contp, packet);
 }
 
 
 TSAction
 INKUDPRecvFrom(TSCont contp, INKUDPConn udp)
 {
+  sdk_assert(sdk_sanity_check_continuation(contp) == TS_SUCCESS);
+
   FORCE_PLUGIN_MUTEX(contp);
-  UDPConnection *conn = (UDPConnection *) udp;
-  return conn->recv((Continuation *) contp);
+  UDPConnection *conn = (UDPConnection *)udp;
+  return conn->recv((Continuation *)contp);
 }
 
 int
 INKUDPConnFdGet(INKUDPConn udp)
 {
-  UDPConnection *conn = (UDPConnection *) udp;
+  UDPConnection *conn = (UDPConnection *)udp;
   return conn->getFd();
 }
 
@@ -425,41 +415,51 @@ INKUDPPacket
 INKUDPPacketCreate()
 {
   UDPPacket *packet = new_UDPPacket();
-  return ((INKUDPPacket) packet);
+  return ((INKUDPPacket)packet);
 }
 
 TSIOBufferBlock
 INKUDPPacketBufferBlockGet(INKUDPPacket packet)
 {
-  UDPPacket *p = (UDPPacket *) packet;
-  return ((TSIOBufferBlock) p->getIOBlockChain());
+  sdk_assert(sdk_sanity_check_null_ptr((void*)packet) == TS_SUCCESS);
+
+  UDPPacket *p = (UDPPacket *)packet;
+  return ((TSIOBufferBlock)p->getIOBlockChain());
 }
 
 unsigned int
 INKUDPPacketFromAddressGet(INKUDPPacket packet)
 {
-  UDPPacket *p = (UDPPacket *) packet;
+  sdk_assert(sdk_sanity_check_null_ptr((void*)packet) == TS_SUCCESS);
+
+  UDPPacket *p = (UDPPacket *)packet;
   return (p->from.sin_addr.s_addr);
 }
 
 int
 INKUDPPacketFromPortGet(INKUDPPacket packet)
 {
-  UDPPacket *p = (UDPPacket *) packet;
+  sdk_assert(sdk_sanity_check_null_ptr((void*)packet) == TS_SUCCESS);
+
+  UDPPacket *p = (UDPPacket *)packet;
   return (ntohs(p->from.sin_port));
 }
 
 INKUDPConn
 INKUDPPacketConnGet(INKUDPPacket packet)
 {
-  UDPPacket *p = (UDPPacket *) packet;
-  return ((INKUDPConn) p->getConnection());
+  sdk_assert(sdk_sanity_check_null_ptr((void*)packet) == TS_SUCCESS);
+
+  UDPPacket *p = (UDPPacket *)packet;
+  return ((INKUDPConn)p->getConnection());
 }
 
 void
 INKUDPPacketDestroy(INKUDPPacket packet)
 {
-  UDPPacket *p = (UDPPacket *) packet;
+  sdk_assert(sdk_sanity_check_null_ptr((void*)packet) == TS_SUCCESS);
+
+  UDPPacket *p = (UDPPacket *)packet;
   p->free();
 }
 
@@ -471,10 +471,12 @@ INKUDPPacketGet(INKUDPacketQueue queuep)
   if (queuep != NULL) {
     UDPPacket *packet;
     Queue<UDPPacket> *qp = (Queue<UDPPacket> *)queuep;
+
     packet = qp->pop();
     return (packet);
-  } else
-    return (NULL);
+  } 
+
+  return NULL;
 }
 
 
@@ -484,86 +486,70 @@ TSIOBuffer
 TSIOBufferCreate()
 {
   MIOBuffer *b = new_empty_MIOBuffer();
-  if (sdk_sanity_check_iocore_structure(b) != TS_SUCCESS) {
-    return (TSIOBuffer) TS_ERROR_PTR;
-  }
 
-  return (TSIOBuffer *) b;
+  // TODO: Should remove this when memory allocations can't fail.
+  sdk_assert(sdk_sanity_check_iocore_structure(b) == TS_SUCCESS);
+  return (TSIOBuffer *)b;
 }
 
 TSIOBuffer
 TSIOBufferSizedCreate(TSIOBufferSizeIndex index)
 {
-  if ((index<TS_IOBUFFER_SIZE_INDEX_128) || (index> TS_IOBUFFER_SIZE_INDEX_32K)) {
-    return (TSIOBuffer) TS_ERROR_PTR;
-  }
+  sdk_assert((index >= TS_IOBUFFER_SIZE_INDEX_128) && (index <= TS_IOBUFFER_SIZE_INDEX_32K));
 
   MIOBuffer *b = new_MIOBuffer(index);
-  if (sdk_sanity_check_iocore_structure(b) != TS_SUCCESS) {
-    return (TSIOBuffer) TS_ERROR_PTR;
-  }
 
-  return (TSIOBuffer *) b;
+  // TODO: Should remove this when memory allocations can't fail.
+  sdk_assert(sdk_sanity_check_iocore_structure(b) == TS_SUCCESS);
+  return (TSIOBuffer *)b;
 }
 
-TSReturnCode
+void
 TSIOBufferDestroy(TSIOBuffer bufp)
 {
-  if (sdk_sanity_check_iocore_structure(bufp) != TS_SUCCESS)
-    return TS_ERROR;
-
-  free_MIOBuffer((MIOBuffer *) bufp);
-  return TS_SUCCESS;
+  sdk_assert(sdk_sanity_check_iocore_structure(bufp) == TS_SUCCESS);
+  free_MIOBuffer((MIOBuffer *)bufp);
 }
 
 TSIOBufferBlock
 TSIOBufferStart(TSIOBuffer bufp)
 {
-  if (sdk_sanity_check_iocore_structure(bufp) != TS_SUCCESS)
-    return (TSIOBufferBlock) TS_ERROR_PTR;
+  sdk_assert(sdk_sanity_check_iocore_structure(bufp) == TS_SUCCESS);
 
-  MIOBuffer *b = (MIOBuffer *) bufp;
+  MIOBuffer *b = (MIOBuffer *)bufp;
   IOBufferBlock *blk = b->get_current_block();
 
-  if (!blk || (blk->write_avail() == 0)) {
+  if (!blk || (blk->write_avail() == 0))
     b->add_block();
-  }
   blk = b->get_current_block();
 
-  // simply return error_ptr
-  // ink_assert (blk != NULL);
-  // ink_debug_assert (blk->write_avail () > 0);
-#ifdef DEBUG
-  if (blk == NULL || (blk->write_avail() <= 0))
-    return (TSIOBufferBlock) TS_ERROR_PTR;
-#endif
+  // TODO: Remove when memory allocations can't fail.
+  sdk_assert(sdk_sanity_check_null_ptr((void*)blk) == TS_SUCCESS);
 
-  return (TSIOBufferBlock) blk;
+  return (TSIOBufferBlock)blk;
 }
 
-TSReturnCode
+void
 TSIOBufferAppend(TSIOBuffer bufp, TSIOBufferBlock blockp)
 {
-  if ((sdk_sanity_check_iocore_structure(bufp) != TS_SUCCESS) ||
-      (sdk_sanity_check_iocore_structure(blockp) != TS_SUCCESS))
-    return TS_ERROR;
+  sdk_assert(sdk_sanity_check_iocore_structure(bufp) == TS_SUCCESS);
+  sdk_assert(sdk_sanity_check_iocore_structure(blockp) == TS_SUCCESS);
 
-  MIOBuffer *b = (MIOBuffer *) bufp;
-  IOBufferBlock *blk = (IOBufferBlock *) blockp;
+  MIOBuffer *b = (MIOBuffer *)bufp;
+  IOBufferBlock *blk = (IOBufferBlock *)blockp;
 
   b->append_block(blk);
-  return TS_SUCCESS;
 }
 
 int64_t
 TSIOBufferCopy(TSIOBuffer bufp, TSIOBufferReader readerp, int64_t length, int64_t offset)
 {
-  if ((sdk_sanity_check_iocore_structure(bufp) != TS_SUCCESS) ||
-      (sdk_sanity_check_iocore_structure(readerp) != TS_SUCCESS) || length < 0 || offset < 0)
-    return TS_ERROR;
+  sdk_assert(sdk_sanity_check_iocore_structure(bufp) == TS_SUCCESS);
+  sdk_assert(sdk_sanity_check_iocore_structure(readerp) == TS_SUCCESS);
+  sdk_assert((length >= 0) && (offset >= 0));
 
-  MIOBuffer *b = (MIOBuffer *) bufp;
-  IOBufferReader *r = (IOBufferReader *) readerp;
+  MIOBuffer *b = (MIOBuffer *)bufp;
+  IOBufferReader *r = (IOBufferReader *)readerp;
 
   return b->write(r, length, offset);
 }
@@ -571,11 +557,11 @@ TSIOBufferCopy(TSIOBuffer bufp, TSIOBuff
 int64_t
 TSIOBufferWrite(TSIOBuffer bufp, const void *buf, int64_t length)
 {
-  if ((sdk_sanity_check_iocore_structure(bufp) != TS_SUCCESS) || (buf == NULL) || (length < 0)) {
-    return TS_ERROR;
-  }
+  sdk_assert(sdk_sanity_check_iocore_structure(bufp) == TS_SUCCESS);
+  sdk_assert(sdk_sanity_check_null_ptr((void*)buf) == TS_SUCCESS);
+  sdk_assert(length >= 0);
 
-  MIOBuffer *b = (MIOBuffer *) bufp;
+  MIOBuffer *b = (MIOBuffer *)bufp;
   return b->write(buf, length);
 }
 
@@ -583,97 +569,94 @@ TSIOBufferWrite(TSIOBuffer bufp, const v
 void
 TSIOBufferReaderCopy(TSIOBufferReader readerp, const void *buf, int64_t length)
 {
-  IOBufferReader *r = (IOBufferReader *) readerp;
+  IOBufferReader *r = (IOBufferReader *)readerp;
   r->memcpy(buf, length);
 }
 
-TSReturnCode
+void
 TSIOBufferProduce(TSIOBuffer bufp, int64_t nbytes)
 {
-  if ((sdk_sanity_check_iocore_structure(bufp) != TS_SUCCESS) || nbytes < 0)
-    return TS_ERROR;
+  sdk_assert(sdk_sanity_check_iocore_structure(bufp) == TS_SUCCESS);
+  sdk_assert(nbytes >= 0);
 
-  MIOBuffer *b = (MIOBuffer *) bufp;
+  MIOBuffer *b = (MIOBuffer *)bufp;
   b->fill(nbytes);
-  return TS_SUCCESS;
 }
 
 TSIOBufferData
 TSIOBufferDataCreate(void *data, int64_t size, TSIOBufferDataFlags flags)
 {
-#ifdef DEBUG
-  if (data == NULL || data == TS_ERROR_PTR || size <= 0 ||
-      ((flags != TS_DATA_ALLOCATE) && (flags != TS_DATA_MALLOCED) && (flags != TS_DATA_CONSTANT)))
-    return (TSIOBufferData) TS_ERROR_PTR;
-#endif
+  sdk_assert(sdk_sanity_check_null_ptr((void*)data) == TS_SUCCESS);
+  sdk_assert(size > 0);
+
   // simply return error_ptr
   //ink_assert (size > 0);
 
   switch (flags) {
   case TS_DATA_ALLOCATE:
     ink_assert(data == NULL);
-    return (TSIOBufferData) new_IOBufferData(iobuffer_size_to_index(size));
+    return (TSIOBufferData)new_IOBufferData(iobuffer_size_to_index(size));
 
   case TS_DATA_MALLOCED:
     ink_assert(data != NULL);
-    return (TSIOBufferData) new_xmalloc_IOBufferData(data, size);
+    return (TSIOBufferData)new_xmalloc_IOBufferData(data, size);
 
   case TS_DATA_CONSTANT:
     ink_assert(data != NULL);
-    return (TSIOBufferData) new_constant_IOBufferData(data, size);
+    return (TSIOBufferData)new_constant_IOBufferData(data, size);
   }
-  // simply return error_ptr
-  // ink_assert (!"not reached");
-  return (TSIOBufferData) TS_ERROR_PTR;
+
+  sdk_assert(!"Invalid flag");
+  return NULL;
 }
 
 TSIOBufferBlock
 TSIOBufferBlockCreate(TSIOBufferData datap, int64_t size, int64_t offset)
 {
-  if ((sdk_sanity_check_iocore_structure(datap) != TS_SUCCESS) || size < 0 || offset < 0)
-    return (TSIOBufferBlock) TS_ERROR;
+  sdk_assert(sdk_sanity_check_iocore_structure(datap) == TS_SUCCESS);
+  sdk_assert((size >= 0) && (offset > 0));
 
-  IOBufferData *d = (IOBufferData *) datap;
-  return (TSIOBufferBlock) new_IOBufferBlock(d, size, offset);
+  IOBufferData *d = (IOBufferData *)datap;
+  return (TSIOBufferBlock)new_IOBufferBlock(d, size, offset);
 }
 
 // dev API, not exposed
-TSReturnCode
+void
 TSIOBufferBlockDestroy(TSIOBufferBlock blockp)
 {
-  IOBufferBlock *blk = (IOBufferBlock *) blockp;
+  sdk_assert(sdk_sanity_check_iocore_structure(blockp) == TS_SUCCESS);
+
+  IOBufferBlock *blk = (IOBufferBlock *)blockp;
   blk->free();
-  return TS_SUCCESS;
 }
 
 TSIOBufferBlock
 TSIOBufferBlockNext(TSIOBufferBlock blockp)
 {
-  if (sdk_sanity_check_iocore_structure(blockp) != TS_SUCCESS) {
-    return (TSIOBuffer) TS_ERROR_PTR;
-  }
+  sdk_assert(sdk_sanity_check_iocore_structure(blockp) == TS_SUCCESS);
 
-  IOBufferBlock *blk = (IOBufferBlock *) blockp;
-  return (TSIOBufferBlock) ((IOBufferBlock *) blk->next);
+  IOBufferBlock *blk = (IOBufferBlock *)blockp;
+  return (TSIOBufferBlock)((IOBufferBlock *)blk->next);
 }
 
 // dev API, not exposed
 int64_t
 TSIOBufferBlockDataSizeGet(TSIOBufferBlock blockp)
 {
-  IOBufferBlock *blk = (IOBufferBlock *) blockp;
+  sdk_assert(sdk_sanity_check_iocore_structure(blockp) == TS_SUCCESS);
+
+  IOBufferBlock *blk = (IOBufferBlock *)blockp;
   return (blk->read_avail());
 }
 
 const char *
 TSIOBufferBlockReadStart(TSIOBufferBlock blockp, TSIOBufferReader readerp, int64_t *avail)
 {
-  if ((sdk_sanity_check_iocore_structure(blockp) != TS_SUCCESS) ||
-      (sdk_sanity_check_iocore_structure(readerp) != TS_SUCCESS))
-    return (const char *) TS_ERROR_PTR;
+  sdk_assert(sdk_sanity_check_iocore_structure(blockp) == TS_SUCCESS);
+  sdk_assert(sdk_sanity_check_iocore_structure(readerp) == TS_SUCCESS);
 
-  IOBufferBlock *blk = (IOBufferBlock *) blockp;
-  IOBufferReader *reader = (IOBufferReader *) readerp;
+  IOBufferBlock *blk = (IOBufferBlock *)blockp;
+  IOBufferReader *reader = (IOBufferReader *)readerp;
   char *p;
 
   p = blk->start();
@@ -691,18 +674,17 @@ TSIOBufferBlockReadStart(TSIOBufferBlock
     }
   }
 
-  return (const char *) p;
+  return (const char *)p;
 }
 
 int64_t
 TSIOBufferBlockReadAvail(TSIOBufferBlock blockp, TSIOBufferReader readerp)
 {
-  if ((sdk_sanity_check_iocore_structure(blockp) != TS_SUCCESS) ||
-      (sdk_sanity_check_iocore_structure(readerp) != TS_SUCCESS))
-    return TS_ERROR;
+  sdk_assert(sdk_sanity_check_iocore_structure(blockp) == TS_SUCCESS);
+  sdk_assert(sdk_sanity_check_iocore_structure(readerp) == TS_SUCCESS);
 
-  IOBufferBlock *blk = (IOBufferBlock *) blockp;
-  IOBufferReader *reader = (IOBufferReader *) readerp;
+  IOBufferBlock *blk = (IOBufferBlock *)blockp;
+  IOBufferReader *reader = (IOBufferReader *)readerp;
   int64_t avail;
 
   avail = blk->read_avail();
@@ -720,117 +702,101 @@ TSIOBufferBlockReadAvail(TSIOBufferBlock
 char *
 TSIOBufferBlockWriteStart(TSIOBufferBlock blockp, int64_t *avail)
 {
-  if (sdk_sanity_check_iocore_structure(blockp) != TS_SUCCESS)
-    return (char *) TS_ERROR_PTR;
+  sdk_assert(sdk_sanity_check_iocore_structure(blockp) == TS_SUCCESS);
 
-  IOBufferBlock *blk = (IOBufferBlock *) blockp;
-  if (avail) {
+  IOBufferBlock *blk = (IOBufferBlock *)blockp;
+
+  if (avail)
     *avail = blk->write_avail();
-  }
   return blk->end();
 }
 
 int64_t
 TSIOBufferBlockWriteAvail(TSIOBufferBlock blockp)
 {
-  if (sdk_sanity_check_iocore_structure(blockp) != TS_SUCCESS) {
-    return TS_ERROR;
-  }
+  sdk_assert(sdk_sanity_check_iocore_structure(blockp) == TS_SUCCESS);
 
-  IOBufferBlock *blk = (IOBufferBlock *) blockp;
+  IOBufferBlock *blk = (IOBufferBlock *)blockp;
   return blk->write_avail();
 }
 
-TSReturnCode
-TSIOBufferWaterMarkGet(TSIOBuffer bufp, int64_t *water_mark)
+int64_t
+TSIOBufferWaterMarkGet(TSIOBuffer bufp)
 {
-  if ((sdk_sanity_check_iocore_structure(bufp) != TS_SUCCESS) || (water_mark == NULL)) {
-    return TS_ERROR;
-  }
+  sdk_assert(sdk_sanity_check_iocore_structure(bufp) == TS_SUCCESS);
 
-  MIOBuffer *b = (MIOBuffer *) bufp;
-  *water_mark = b->water_mark;
-  return TS_SUCCESS;
+  MIOBuffer *b = (MIOBuffer *)bufp;
+  return b->water_mark;
 }
 
-TSReturnCode
+void
 TSIOBufferWaterMarkSet(TSIOBuffer bufp, int64_t water_mark)
 {
-  if ((sdk_sanity_check_iocore_structure(bufp) != TS_SUCCESS) || water_mark < 0)
-    return TS_ERROR;
+  sdk_assert(sdk_sanity_check_iocore_structure(bufp) == TS_SUCCESS);
+  sdk_assert(water_mark >= 0);
 
-  MIOBuffer *b = (MIOBuffer *) bufp;
+  MIOBuffer *b = (MIOBuffer *)bufp;
   b->water_mark = water_mark;
-  return TS_SUCCESS;
 }
 
 TSIOBufferReader
 TSIOBufferReaderAlloc(TSIOBuffer bufp)
 {
-  if (sdk_sanity_check_iocore_structure(bufp) != TS_SUCCESS)
-    return (TSIOBufferReader) TS_ERROR_PTR;
+  sdk_assert(sdk_sanity_check_iocore_structure(bufp) == TS_SUCCESS);
 
-  MIOBuffer *b = (MIOBuffer *) bufp;
-  TSIOBufferReader readerp = (TSIOBufferReader) b->alloc_reader();
+  MIOBuffer *b = (MIOBuffer *)bufp;
+  TSIOBufferReader readerp = (TSIOBufferReader)b->alloc_reader();
 
-#ifdef DEBUG
-  if (readerp == NULL)
-    return (TSIOBufferReader) TS_ERROR_PTR;
-#endif
+  // TODO: Should remove this when memory allocation can't fail.
+  sdk_assert(sdk_sanity_check_null_ptr((void*)readerp) == TS_SUCCESS);
   return readerp;
 }
 
 TSIOBufferReader
 TSIOBufferReaderClone(TSIOBufferReader readerp)
 {
-  if (sdk_sanity_check_iocore_structure(readerp) != TS_SUCCESS)
-    return (TSIOBufferReader) TS_ERROR_PTR;
+  sdk_assert(sdk_sanity_check_iocore_structure(readerp) == TS_SUCCESS);
 
-  IOBufferReader *r = (IOBufferReader *) readerp;
-  return (TSIOBufferReader) r->clone();
+  IOBufferReader *r = (IOBufferReader *)readerp;
+  return (TSIOBufferReader)r->clone();
 }
 
-TSReturnCode
+void
 TSIOBufferReaderFree(TSIOBufferReader readerp)
 {
-  if (sdk_sanity_check_iocore_structure(readerp) != TS_SUCCESS)
-    return TS_ERROR;
+  sdk_assert(sdk_sanity_check_iocore_structure(readerp) == TS_SUCCESS);
 
-  IOBufferReader *r = (IOBufferReader *) readerp;
+  IOBufferReader *r = (IOBufferReader *)readerp;
   r->mbuf->dealloc_reader(r);
-  return TS_SUCCESS;
 }
 
 TSIOBufferBlock
 TSIOBufferReaderStart(TSIOBufferReader readerp)
 {
-  if (sdk_sanity_check_iocore_structure(readerp) != TS_SUCCESS)
-    return (TSIOBufferBlock) TS_ERROR_PTR;
+  sdk_assert(sdk_sanity_check_iocore_structure(readerp) == TS_SUCCESS);
 
-  IOBufferReader *r = (IOBufferReader *) readerp;
-  if (r->block != NULL) {
+  IOBufferReader *r = (IOBufferReader *)readerp;
+
+  if (r->block != NULL)
     r->skip_empty_blocks();
-  }
-  return (TSIOBufferBlock) r->block;
+  return (TSIOBufferBlock)r->block;
 }
 
-TSReturnCode
+void
 TSIOBufferReaderConsume(TSIOBufferReader readerp, int64_t nbytes)
 {
-  if ((sdk_sanity_check_iocore_structure(readerp) != TS_SUCCESS) || nbytes < 0)
-    return TS_ERROR;
+  sdk_assert(sdk_sanity_check_iocore_structure(readerp) == TS_SUCCESS);
+  sdk_assert(nbytes >= 0);
 
-  IOBufferReader *r = (IOBufferReader *) readerp;
+  IOBufferReader *r = (IOBufferReader *)readerp;
   r->consume(nbytes);
-  return TS_SUCCESS;
 }
 
 int64_t
 TSIOBufferReaderAvail(TSIOBufferReader readerp)
 {
-  if (sdk_sanity_check_iocore_structure(readerp) != TS_SUCCESS)
-    return TS_ERROR;
+  sdk_assert(sdk_sanity_check_iocore_structure(readerp) == TS_SUCCESS);
 
-  IOBufferReader *r = (IOBufferReader *) readerp;
+  IOBufferReader *r = (IOBufferReader *)readerp;
   return r->read_avail();
 }

Modified: trafficserver/traffic/trunk/proxy/api/ts/InkAPIPrivateIOCore.h
URL: http://svn.apache.org/viewvc/trafficserver/traffic/trunk/proxy/api/ts/InkAPIPrivateIOCore.h?rev=1071493&r1=1071492&r2=1071493&view=diff
==============================================================================
--- trafficserver/traffic/trunk/proxy/api/ts/InkAPIPrivateIOCore.h (original)
+++ trafficserver/traffic/trunk/proxy/api/ts/InkAPIPrivateIOCore.h Thu Feb 17 03:13:04 2011
@@ -178,7 +178,7 @@ extern "C"
 /* IOBuffer */
   tsapi void TSIOBufferReaderCopy(TSIOBufferReader readerp, const void *buf, int64_t length);
   tsapi int64_t TSIOBufferBlockDataSizeGet(TSIOBufferBlock blockp);
-  tsapi TSReturnCode TSIOBufferBlockDestroy(TSIOBufferBlock blockp);
+  tsapi void TSIOBufferBlockDestroy(TSIOBufferBlock blockp);
   typedef void *INKUDPPacket;
   typedef void *INKUDPacketQueue;
   typedef void *INKUDPConn;

Modified: trafficserver/traffic/trunk/proxy/api/ts/ts.h.in
URL: http://svn.apache.org/viewvc/trafficserver/traffic/trunk/proxy/api/ts/ts.h.in?rev=1071493&r1=1071492&r2=1071493&view=diff
==============================================================================
--- trafficserver/traffic/trunk/proxy/api/ts/ts.h.in (original)
+++ trafficserver/traffic/trunk/proxy/api/ts/ts.h.in Thu Feb 17 03:13:04 2011
@@ -1943,16 +1943,16 @@ extern "C"
      Threads */
   tsapi TSThread TSThreadCreate(TSThreadFunc func, void *data);
   tsapi TSThread TSThreadInit(void);
-  tsapi TSReturnCode TSThreadDestroy(TSThread thread);
+  tsapi void TSThreadDestroy(TSThread thread);
   tsapi TSThread TSThreadSelf(void);
 
   /* --------------------------------------------------------------------------
      Mutexes */
   tsapi TSMutex TSMutexCreate(void);
-  tsapi TSReturnCode TSMutexLock(TSMutex mutexp);
-  tsapi TSReturnCode TSMutexLockTry(TSMutex mutexp, int *lock);
+  tsapi void TSMutexLock(TSMutex mutexp);
+  tsapi void TSMutexLockTry(TSMutex mutexp, int *lock);
 
-  tsapi TSReturnCode TSMutexUnlock(TSMutex mutexp);
+  tsapi void TSMutexUnlock(TSMutex mutexp);
 
   /* --------------------------------------------------------------------------
      cachekey */
@@ -2437,13 +2437,13 @@ extern "C"
 
   /* --------------------------------------------------------------------------
      VIOs */
-  tsapi TSReturnCode TSVIOReenable(TSVIO viop);
+  tsapi void TSVIOReenable(TSVIO viop);
   tsapi TSIOBuffer TSVIOBufferGet(TSVIO viop);
   tsapi TSIOBufferReader TSVIOReaderGet(TSVIO viop);
   tsapi int64_t TSVIONBytesGet(TSVIO viop);
-  tsapi TSReturnCode TSVIONBytesSet(TSVIO viop, int64_t nbytes);
+  tsapi void TSVIONBytesSet(TSVIO viop, int64_t nbytes);
   tsapi int64_t TSVIONDoneGet(TSVIO viop);
-  tsapi TSReturnCode TSVIONDoneSet(TSVIO viop, int64_t ndone);
+  tsapi void TSVIONDoneSet(TSVIO viop, int64_t ndone);
   tsapi int64_t TSVIONTodoGet(TSVIO viop);
   tsapi TSMutex TSVIOMutexGet(TSVIO viop);
   tsapi TSCont TSVIOContGet(TSVIO viop);
@@ -2473,11 +2473,9 @@ extern "C"
       in bytes, for a specified TSIOBuffer.
 
       @param bufp buffer whose watermark the function gets.
-      @param water_mark will be set to the current watermark of the
-        provided TSIOBuffer.
 
    */
-  tsapi TSReturnCode TSIOBufferWaterMarkGet(TSIOBuffer bufp, int64_t *water_mark);
+  tsapi int64_t TSIOBufferWaterMarkGet(TSIOBuffer bufp);
 
   /**
       The watermark of an TSIOBuffer is the minimum number of bytes
@@ -2493,9 +2491,9 @@ extern "C"
       @param water_mark watermark setting, as a number of bytes.
 
    */
-  tsapi TSReturnCode TSIOBufferWaterMarkSet(TSIOBuffer bufp, int64_t water_mark);
+  tsapi void TSIOBufferWaterMarkSet(TSIOBuffer bufp, int64_t water_mark);
 
-  tsapi TSReturnCode TSIOBufferDestroy(TSIOBuffer bufp);
+  tsapi void TSIOBufferDestroy(TSIOBuffer bufp);
   tsapi TSIOBufferBlock TSIOBufferStart(TSIOBuffer bufp);
   tsapi int64_t TSIOBufferCopy(TSIOBuffer bufp, TSIOBufferReader readerp, int64_t length, int64_t offset);
 
@@ -2512,7 +2510,7 @@ extern "C"
 
    */
   tsapi int64_t TSIOBufferWrite(TSIOBuffer bufp, const void *buf, int64_t length);
-  tsapi TSReturnCode TSIOBufferProduce(TSIOBuffer bufp, int64_t nbytes);
+  tsapi void TSIOBufferProduce(TSIOBuffer bufp, int64_t nbytes);
 
   tsapi TSIOBufferBlock TSIOBufferBlockNext(TSIOBufferBlock blockp);
   tsapi const char *TSIOBufferBlockReadStart(TSIOBufferBlock blockp, TSIOBufferReader readerp, int64_t *avail);
@@ -2522,9 +2520,9 @@ extern "C"
 
   tsapi TSIOBufferReader TSIOBufferReaderAlloc(TSIOBuffer bufp);
   tsapi TSIOBufferReader TSIOBufferReaderClone(TSIOBufferReader readerp);
-  tsapi TSReturnCode TSIOBufferReaderFree(TSIOBufferReader readerp);
+  tsapi void TSIOBufferReaderFree(TSIOBufferReader readerp);
   tsapi TSIOBufferBlock TSIOBufferReaderStart(TSIOBufferReader readerp);
-  tsapi TSReturnCode TSIOBufferReaderConsume(TSIOBufferReader readerp, int64_t nbytes);
+  tsapi void TSIOBufferReaderConsume(TSIOBufferReader readerp, int64_t nbytes);
   tsapi int64_t TSIOBufferReaderAvail(TSIOBufferReader readerp);
 
 
@@ -2839,7 +2837,7 @@ extern "C"
   */
   tsapi TSVConn TSVConnCreate(TSEventFunc event_funcp, TSMutex mutexp);
 
-  tsapi TS_DEPRECATED TSReturnCode TSIOBufferAppend(TSIOBuffer bufp, TSIOBufferBlock blockp);
+  tsapi TS_DEPRECATED void TSIOBufferAppend(TSIOBuffer bufp, TSIOBufferBlock blockp);
   tsapi TS_DEPRECATED TSIOBufferData TSIOBufferDataCreate(void *data, int size, TSIOBufferDataFlags flags);
   tsapi TS_DEPRECATED TSIOBufferBlock TSIOBufferBlockCreate(TSIOBufferData datap, int size, int offset);
 



Mime
View raw message