Author: zwoop
Date: Fri Sep 16 03:33:04 2011
New Revision: 1171373
URL: http://svn.apache.org/viewvc?rev=1171373&view=rev
Log:
Make example plugins compile again
Modified:
trafficserver/traffic/trunk/example/gzip-transform/gzip.c
trafficserver/traffic/trunk/example/redirect-1/redirect-1.c
trafficserver/traffic/trunk/example/remap/remap.cc
trafficserver/traffic/trunk/example/thread-pool/psi.c
Modified: trafficserver/traffic/trunk/example/gzip-transform/gzip.c
URL:
http://svn.apache.org/viewvc/trafficserver/traffic/trunk/example/gzip-transform/gzip.c?rev=1171373&r1=1171372&r2=1171373&view=diff
==============================================================================
--- trafficserver/traffic/trunk/example/gzip-transform/gzip.c (original)
+++ trafficserver/traffic/trunk/example/gzip-transform/gzip.c Fri Sep 16
03:33:04 2011
@@ -219,6 +219,7 @@ gzip_transform_one(GzipData * data, TSIO
/* Encode */
err = deflate(&data->zstrm, Z_NO_FLUSH);
+ TSDebug("gzip-transform", "deflate() returned %d", err);
if (olength > data->zstrm.avail_out) {
TSIOBufferProduce(data->output_buffer, olength -
data->zstrm.avail_out);
Modified: trafficserver/traffic/trunk/example/redirect-1/redirect-1.c
URL:
http://svn.apache.org/viewvc/trafficserver/traffic/trunk/example/redirect-1/redirect-1.c?rev=1171373&r1=1171372&r2=1171373&view=diff
==============================================================================
--- trafficserver/traffic/trunk/example/redirect-1/redirect-1.c (original)
+++ trafficserver/traffic/trunk/example/redirect-1/redirect-1.c Fri Sep 16
03:33:04 2011
@@ -95,7 +95,7 @@ handle_client_lookup(TSHttpTxn txnp, TSC
int host_length;
#if !defined (_WIN32)
- in_addr_t clientip;
+ in_addr_t clientip = 0;
#else
unsigned int clientip;
#endif
@@ -181,6 +181,7 @@ handle_client_lookup(TSHttpTxn txnp, TSC
goto done;
}
+ /* TODO: This is odd, clientip is never set ... */
if (ip_deny == clientip) {
TSHttpTxnHookAdd(txnp, TS_HTTP_SEND_RESPONSE_HDR_HOOK, contp);
Modified: trafficserver/traffic/trunk/example/remap/remap.cc
URL:
http://svn.apache.org/viewvc/trafficserver/traffic/trunk/example/remap/remap.cc?rev=1171373&r1=1171372&r2=1171373&view=diff
==============================================================================
--- trafficserver/traffic/trunk/example/remap/remap.cc (original)
+++ trafficserver/traffic/trunk/example/remap/remap.cc Fri Sep 16 03:33:04 2011
@@ -102,8 +102,8 @@ remap_entry::~remap_entry()
if (argc && argv) {
for (i = 0; i < argc; i++)
- ats_free(argv[i]);
- ats_free(argv);
+ TSfree(argv[i]);
+ TSfree(argv);
}
}
Modified: trafficserver/traffic/trunk/example/thread-pool/psi.c
URL:
http://svn.apache.org/viewvc/trafficserver/traffic/trunk/example/thread-pool/psi.c?rev=1171373&r1=1171372&r2=1171373&view=diff
==============================================================================
--- trafficserver/traffic/trunk/example/thread-pool/psi.c (original)
+++ trafficserver/traffic/trunk/example/thread-pool/psi.c Fri Sep 16 03:33:04
2011
@@ -618,7 +618,6 @@ handle_transform(TSCont contp)
ContData *data;
TSIOBufferReader input_reader;
int toread, avail, psi, toconsume, towrite;
- TSReturnCode retval;
/* Get the output (downstream) vconnection where we'll write data to. */
output_conn = TSTransformOutputVConnGet(contp);
@@ -669,7 +668,8 @@ handle_transform(TSCont contp)
data->transform_bytes += towrite;
/* Copy the data from the read buffer to the output buffer. */
- retval = TSIOBufferCopy(TSVIOBufferGet(data->output_vio),
TSVIOReaderGet(input_vio), towrite, 0);
+ /* TODO: Should we check the return value of TSIOBufferCopy() ? */
+ TSIOBufferCopy(TSVIOBufferGet(data->output_vio),
TSVIOReaderGet(input_vio), towrite, 0);
/* Reenable the output connection so it can read the data we've
produced. */
TSVIOReenable(data->output_vio);
}
@@ -725,10 +725,13 @@ dump_psi(TSCont contp)
{
ContData *data;
int psi_output_len;
- TSVIO input_vio;
- TSReturnCode retval;
+ /* TODO: This is odd, do we need to get the input_vio, but never use it ?? */
+#if 0
+ TSVIO input_vio;
input_vio = TSVConnWriteVIOGet(contp);
+#endif
+
data = TSContDataGet(contp);
TSAssert(data->magic == MAGIC_ALIVE);
@@ -740,7 +743,8 @@ dump_psi(TSCont contp)
data->transform_bytes += psi_output_len;
TSDebug(DBG_TAG, "Inserting %d bytes from include file", psi_output_len);
- retval = TSIOBufferCopy(TSVIOBufferGet(data->output_vio),
data->psi_reader, psi_output_len, 0);
+ /* TODO: Should we check the return value of TSIOBufferCopy() ? */
+ TSIOBufferCopy(TSVIOBufferGet(data->output_vio), data->psi_reader,
psi_output_len, 0);
/* Consume all the output data */
TSIOBufferReaderConsume(data->psi_reader, psi_output_len);