server_total_recvd += buff_tot_len;
for(int i = 0 ; i < buff_count; i++){
server_this_recvd += qbuff[i].Length;
-
}
//printf("server total buff count: %llu\n", server_total_recvd);
case QUIC_CONNECTION_EVENT_SHUTDOWN_COMPLETE:
printf("connection done\n");
quic_api->ConnectionClose(connection);
+ printf("server recvd total: %lu\n", server_this_recvd);
server_done = 1;
break;
case QUIC_CONNECTION_EVENT_PEER_STREAM_STARTED:
QUIC_STATUS status;
HQUIC stream = NULL;
uint8_t* send_buffer_raw = NULL;
- uint8_t* sb_fill = NULL;
+ //uint8_t* sb_fill = NULL;
QUIC_BUFFER* send_buffer;
if (QUIC_FAILED(status = quic_api->StreamOpen(connection, QUIC_STREAM_OPEN_FLAG_NONE, client_stream_cb, NULL, &stream))) {
goto error;
}
client_total_sent += quic_send_buffer_len;
- //printf("client sent: %lu\n", client_total_sent);
if(client_total_sent >= INPUT_BUFF_MAX){
send_buffer->Length = 0;
if (QUIC_FAILED(status = quic_api->StreamSend(stream, send_buffer, 1, QUIC_SEND_FLAG_FIN, send_buffer))) {
break;
}
}
+ printf("client sent total: %lu\n", client_total_sent);
gettimeofday(&t2, NULL);
uint32_t seconds = t2.tv_sec - t1.tv_sec;
- uint32_t ms = (t2.tv_usec - t1.tv_usec) / 1000;
-
- printf("sec: %lu ms: %lu\n", seconds, ms);
+ int ms = (t2.tv_usec - t1.tv_usec) / 1000;
+ if(ms < 0){
+ ms = ms * -1;
+ }
+ printf("sec: %u ms: %d\n", seconds, ms);
error:
}
QUIC_STATUS status;
- const char* resumption_ticket_string = NULL;
+ //const char* resumption_ticket_string = NULL;
HQUIC connection = NULL;
//printf("progress: %.2f\n", percent);
- if(total_sent > INPUT_BUFF_MAX){
+ if(total_sent >= INPUT_BUFF_MAX){
keepalive = 0;
continue;
}
}
- if(total_sent <= INPUT_BUFF_MAX){
+ if(total_sent < INPUT_BUFF_MAX){
printf("connection closed before sending completed\n");
return -4;
}
gettimeofday(&t2, NULL);
uint32_t seconds = t2.tv_sec - t1.tv_sec;
- uint32_t ms = (t2.tv_usec - t1.tv_usec) / 1000;
+ int ms = (t2.tv_usec - t1.tv_usec) / 1000;
+ if(ms < 0){
+ ms = ms * -1;
+ }
- printf("sec: %lu ms: %lu\n", seconds, ms);
- printf("total sent: " "%" PRIu64 "\n", total_sent);
+ printf("client sent total: " "%" PRIu64 "\n", total_sent);
+ printf("sec: %u ms: %d\n", seconds, ms);
return 0;
}
static int server(){
+ uint64_t server_recvd_total = 0;
+
SSL *ssl;
SSL_CTX *ctx;
SSL_METHOD *method;
}
+ server_recvd_total += (uint64_t)valread;
+
if(keepalive == 0){
continue;
}
}
+ printf("server recvd total: " "%" PRIu64 "\n", server_recvd_total);
+
close(connfd);
}