Permalink
Browse files

TS-594 Migrate from our own int64 (et.al) to int64_t / stdint types.

Tested: gcc 4.1.2, gcc 4.3.2, gcc 4.4, gcc 4.5.1, Intel CC 11.x, Clang (trunk)
Platforms: Fedora Core 14 (64-bit), FC8, FreeBSD8, Ubuntu 8.10
 	   Ubuntu 10.10 (64-bit).

git-svn-id: https://svn.apache.org/repos/asf/trafficserver/traffic/trunk@1049373 13f79535-47bb-0310-9956-ffa450edef68
  • Loading branch information...
1 parent 6ad3b8f commit 4fb3b6eb3286793a6996aef6e106beb1b7df719f @zwoop zwoop committed Dec 15, 2010
Showing 306 changed files with 3,479 additions and 3,428 deletions.
View
@@ -2,6 +2,59 @@
Changes with Apache Traffic Server 2.1.5
+ *) Migrate from our own int64 (et.al) to int64_t / stdint types. This also
+ changes the SDK, so ts/ts.h users should now use int64_t etc. [TS-594].
+
+ *)./configure will now tell us more about its defaults.
+
+ *) Add better tests for eventfd, making sure sys/eventfd.h exists
+ [TS-515].
+
+ *) Stub / base implementation for the Task thread pool [TS-589].
+
+ *) Cleanup of traffic_logstats, and also add support for JSON
+ output. Several new options and query args added to select output format
+ and data [TS-587].
+
+ *) Add back support for using the default DNSHandler from DNS.cc
+ This helps with SplitDNS [TS-580].
+
+ *) Fixes for DNS to properly schedule and initialize [TS-570].
+
+ *) Fix make check so it actually compiles [TS-586].
+
+ *) Remove RAF pieces [TS-584].
+
+ *) Replace the SDKAllocator with a ClassAllocator [TS-577].
+
+ This reduces the amount of memory allocation for plugins,
+ but requires that plugins now religiously release the
+ handles that they are expected to release (i.e. no automatic
+ gc is done for lazy developers).
+
+
+ *) Fixes for getting the altinfo regression check to succeeds [TS-171].
+
+ *) Fixes for some transform, and other, mismatches of int vs int64 in the
+ new APIs and underlying cache [TS-456].
+
+ *) Eliminate misguided string copies in the SDK [TS-579].
+
+ *) Fix build of ts.h and tsxs when the .in files changes [TS-574].
+
+ *) Move libinktomi++ and librecords to lib/ts and lib/records [TS-571].
+
+ *) Add SDK API calls to directly get the elements of the running TS
+ version [TS-568].
+
+ *) Added WCCP support.
+
+ *) Bring IPv6 functionality back to trunk, for incoming (client)
+ connections [TS-18]. Original author: Tsunayoshi Egawa.
+
+ *) Segfault with HTTPS, fixed by correctly initializing SSLNetVConnection
+ being added to freelist [TS-559].
+
*) The old logs.config custom log format is no longer supported. Only
the XML custom logs are now supported. This eliminates the config
@@ -207,7 +207,7 @@ int main(int argc, char * argv[])
if (!use_accept_thread) {
RecInt tmp = 0;
RecGetRecordInt("proxy.config.accept_threads",(RecInt*) &tmp);
- use_accept_thread = (int32)tmp; \
+ use_accept_thread = (int32_t)tmp; \
}
if (initialize_store()) { // cache
@@ -328,7 +328,7 @@ load(const char *filename)
TSFile fp;
TSIOBufferBlock blk;
char *p;
- int64 avail;
+ int64_t avail;
int err;
fp = TSfopen(filename, "r");
@@ -50,7 +50,7 @@ struct cache_scan_state_t
TSAction pending_action;
TSCacheKey key_to_delete;
- int64 total_bytes;
+ int64_t total_bytes;
int total_items;
int done;
@@ -167,7 +167,7 @@ gzip_transform_one(GzipData * data, TSIOBufferReader input_reader, int amount)
TSIOBufferBlock blkp;
const char *ibuf;
char *obuf;
- int64 ilength, olength;
+ int64_t ilength, olength;
int err = Z_OK;
while (amount > 0) {
@@ -236,7 +236,7 @@ gzip_transform_finish(GzipData * data)
if (data->state == 1) {
TSIOBufferBlock blkp;
char *obuf;
- int64 olength;
+ int64_t olength;
int err;
data->state = 2;
@@ -196,7 +196,7 @@ gzip_transform_one(GzipData * data, TSIOBufferReader input_reader, int amount)
TSIOBufferBlock blkp;
const char *ibuf;
char *obuf;
- int64 ilength, olength;
+ int64_t ilength, olength;
int err;
while (amount > 0) {
@@ -248,7 +248,7 @@ gzip_transform_finish(GzipData * data)
if (data->state == 1) {
TSIOBufferBlock blkp;
char *obuf;
- int64 olength;
+ int64_t olength;
int err;
data->state = 2;
@@ -36,6 +36,10 @@
#include <stdio.h>
#include <ts/ts.h>
+// This gets the PRI*64 types
+# define __STDC_FORMAT_MACROS 1
+# include <inttypes.h>
+
typedef struct
{
TSVIO output_vio;
@@ -74,8 +78,8 @@ handle_transform(TSCont contp)
TSIOBuffer buf_test;
TSVIO input_vio;
MyData *data;
- int64 towrite;
- int64 avail;
+ int64_t towrite;
+ int64_t avail;
TSDebug("null-transform", "Entering handle_transform()");
/* Get the output (downstream) vconnection where we'll write data to. */
@@ -146,14 +150,14 @@ handle_transform(TSCont contp)
* to write to the output connection.
*/
towrite = TSVIONTodoGet(input_vio);
- TSDebug("null-transform", "\ttoWrite is %lld", towrite);
+ TSDebug("null-transform", "\ttoWrite is %" PRId64 "", towrite);
if (towrite > 0) {
/* The amount of data left to read needs to be truncated by
* the amount of data actually in the read buffer.
*/
avail = TSIOBufferReaderAvail(TSVIOReaderGet(input_vio));
- TSDebug("null-transform", "\tavail is %lld", avail);
+ TSDebug("null-transform", "\tavail is %" PRId64 "", avail);
if (towrite > avail) {
towrite = avail;
}
@@ -59,10 +59,10 @@ handle_dns(TSHttpTxn txnp, TSCont contp)
TSIOBufferBlock block;
const char *block_start;
- int64 block_avail;
+ int64_t block_avail;
char *output_string;
- int64 output_len;
+ int64_t output_len;
if (!TSHttpTxnClientReqGet(txnp, &bufp, &hdr_loc)) {
TSDebug(DEBUG_TAG, "couldn't retrieve client request header");
@@ -259,7 +259,7 @@ int
state_handle_cache_lookup(TSCont contp, TSEvent event, TSVConn vc)
{
TxnSM *txn_sm = (TxnSM *) TSContDataGet(contp);
- int64 response_size;
+ int64_t response_size;
int ret_val;
TSDebug("protocol", "enter state_handle_cache_lookup");
@@ -896,7 +896,7 @@ get_info_from_buffer(TSIOBufferReader the_reader)
char *info;
char *info_start;
- int64 read_avail, read_done;
+ int64_t read_avail, read_done;
TSIOBufferBlock blk;
char *buf;
@@ -53,7 +53,7 @@ typedef struct _TxnSM
char *q_key;
char *q_server_name;
- uint32 q_server_ip;
+ uint32_t q_server_ip;
int q_server_port;
TSVIO q_client_read_vio;
@@ -313,7 +313,7 @@ update_redirected_method_stats(TSMBuffer bufp, TSMLoc hdr_loc)
{
const char *txn_method;
int length;
- int64 tempint;
+ int64_t tempint;
txn_method = TSHttpHdrMethodGet(bufp, hdr_loc, &length);
@@ -538,9 +538,9 @@ transform_read_status_event(TSCont contp, TransformData * data, TSEvent event, v
TSIOBufferBlock blk;
char *buf;
void *buf_ptr;
- int64 avail;
- int64 read_nbytes = sizeof(int);
- int64 read_ndone = 0;
+ int64_t avail;
+ int64_t read_nbytes = sizeof(int);
+ int64_t read_ndone = 0;
buf_ptr = &data->content_length;
while (read_nbytes > 0) {
@@ -40,7 +40,7 @@ static INKStat av_transaction;
static void
txn_handler(TSHttpTxn txnp, TSCont contp)
{
- int64 num_txns = 0;
+ int64_t num_txns = 0;
INKStatIncrement(transaction_count);
INKStatIntGet(transaction_count, &num_txns);
@@ -52,7 +52,7 @@ txn_handler(TSHttpTxn txnp, TSCont contp)
static void
handle_session(TSHttpSsn ssnp, TSCont contp)
{
- int64 num_ssn = 0;
+ int64_t num_ssn = 0;
INKStatIncrement(session_count);
INKStatIntGet(session_count, &num_ssn);
@@ -239,7 +239,7 @@ strsearch_ioreader(TSIOBufferReader reader, const char *pattern, int *nparse)
/* Loop thru each block while we've not yet found the pattern */
while ((block != NULL) && (index < slen)) {
- int64 blocklen;
+ int64_t blocklen;
const char *blockptr = TSIOBufferBlockReadStart(block, reader, &blocklen);
const char *ptr;
@@ -320,7 +320,7 @@ strextract_ioreader(TSIOBufferReader reader, int offset, const char *end_pattern
/* Now start extraction */
while ((block != NULL) && (p_idx < plen) && (buf_idx < PSI_FILENAME_MAX_SIZE)) {
- int64 blocklen;
+ int64_t blocklen;
const char *blockptr = TSIOBufferBlockReadStart(block, reader, &blocklen);
if (blockptr == TS_ERROR_PTR) {
@@ -547,7 +547,7 @@ psi_include(TSCont contp, void *edata)
while (TSfgets(filep, buf, BUFFER_SIZE) != NULL) {
TSIOBufferBlock block;
- int64 len, avail, ndone, ntodo, towrite;
+ int64_t len, avail, ndone, ntodo, towrite;
char *ptr_block;
len = strlen(buf);
View
@@ -47,10 +47,10 @@ int thread_is_created = 0;
// AIO Stats
-uint64 aio_num_read = 0;
-uint64 aio_bytes_read = 0;
-uint64 aio_num_write = 0;
-uint64 aio_bytes_written = 0;
+uint64_t aio_num_read = 0;
+uint64_t aio_bytes_read = 0;
+uint64_t aio_num_write = 0;
+uint64_t aio_bytes_written = 0;
static void aio_move(AIO_Reqs *req);
@@ -64,9 +64,9 @@ aio_stats_cb(const char *name, RecDataT data_type, RecData *data, RecRawStatBloc
NOWARN_UNUSED(name);
(void) data_type;
(void) rsb;
- int64 new_val = 0;
- int64 diff = 0;
- int64 count, sum;
+ int64_t new_val = 0;
+ int64_t diff = 0;
+ int64_t count, sum;
ink_hrtime now = ink_get_hrtime();
// The RecGetGlobalXXX stat functions are cheaper than the
// RecGetXXX functions. The Global ones are expensive
@@ -75,7 +75,7 @@ aio_stats_cb(const char *name, RecDataT data_type, RecData *data, RecRawStatBloc
RecGetGlobalRawStatSum(aio_rsb, id, &sum);
RecGetGlobalRawStatCount(aio_rsb, id, &count);
- int64 time_diff = ink_hrtime_to_msec(now - count);
+ int64_t time_diff = ink_hrtime_to_msec(now - count);
if (time_diff == 0) {
data->rec_float = 0.0;
return 0;
View
@@ -33,10 +33,10 @@
extern Continuation *aio_err_callbck;
// AIO Stats
-extern uint64 aio_num_read;
-extern uint64 aio_bytes_read;
-extern uint64 aio_num_write;
-extern uint64 aio_bytes_written;
+extern uint64_t aio_num_read;
+extern uint64_t aio_bytes_read;
+extern uint64_t aio_num_write;
+extern uint64_t aio_bytes_written;
NTIOCompletionPort aio_completion_port(1);
@@ -57,9 +57,9 @@ class BCSV_impl:public BlockCacheSegmentVConnection
}
};
- virtual VIO *do_io_write(Continuation * c = NULL, int64 nbytes = 0, IOBufferReader * buf = NULL, bool owner = false);
+ virtual VIO *do_io_write(Continuation * c = NULL, int64_t nbytes = 0, IOBufferReader * buf = NULL, bool owner = false);
- virtual VIO *do_io_read(Continuation * c, int64 nbytes, MIOBuffer * buf);
+ virtual VIO *do_io_read(Continuation * c, int64_t nbytes, MIOBuffer * buf);
virtual void do_io_close(int err = -1) {
};
@@ -89,7 +89,7 @@ BCSV_impl::~BCSV_impl()
}
VIO *
-BCSV_impl::do_io_write(Continuation * c, int64 nbytes, IOBufferReader * buf, bool owner)
+BCSV_impl::do_io_write(Continuation * c, int64_t nbytes, IOBufferReader * buf, bool owner)
{
// call into BC_OpenSegment for io strategy
@@ -109,7 +109,7 @@ BCSV_impl::do_io_write(Continuation * c, int64 nbytes, IOBufferReader * buf, boo
}
VIO *
-BCSV_impl::do_io_read(Continuation * c, int64 nbytes, MIOBuffer * buf)
+BCSV_impl::do_io_read(Continuation * c, int64_t nbytes, MIOBuffer * buf)
{
// call into BC_OpenSegment for io strategy
@@ -26,8 +26,7 @@
#ifndef _CacheLog_H_
#define _CacheLog_H_
-typedef int int32;
-typedef int32 XactId;
+typedef int32_t XactId;
typedef int BlockOffset;
typedef char Dir[8];
@@ -1415,7 +1415,7 @@ test3b()
int
main(int argc, char *argv[])
{
- printf("disksize = %lld MB, %lld blocks\n", DISKSIZE / (1 << 20), MAX_BLOCKS);
+ printf("disksize = %" PRId64 " MB, %" PRId64 " blocks\n", DISKSIZE / (1 << 20), MAX_BLOCKS);
allocInit();
check_rlestate();
//test_rle0();
@@ -1553,8 +1553,8 @@ main(int argc, char *argv[])
if (!print_fraginfo) {
int usecs = (end.tv_sec - start.tv_sec) * 1000000 + end.tv_usec - start.tv_usec;
printf("%d us\n", usecs);
- printf("%lld ns (elapsed) per call (%d calls)\n", usecs * 1000LL / calls, calls);
- printf("%lld ns (elapsed) per op (consisting of multiple free & alloc) (%d ops)\n", usecs * 1000LL / ops, ops);
+ printf("%" PRId64 " ns (elapsed) per call (%d calls)\n", usecs * 1000LL / calls, calls);
+ printf("%" PRId64 " ns (elapsed) per op (consisting of multiple free & alloc) (%d ops)\n", usecs * 1000LL / ops, ops);
//dumpAllocState();
}
print_rlestate();
Oops, something went wrong. Retry.

0 comments on commit 4fb3b6e

Please sign in to comment.