Skip to Content.
Sympa Menu

ndt-dev - [ndt-dev] [ndt] r460 committed - Add client application meta datum.

Subject: NDT-DEV email list created

List archive

[ndt-dev] [ndt] r460 committed - Add client application meta datum.


Chronological Thread 
  • From:
  • To:
  • Subject: [ndt-dev] [ndt] r460 committed - Add client application meta datum.
  • Date: Fri, 05 Aug 2011 16:54:00 +0000

Revision: 460
Author:

Date: Fri Aug 5 09:53:31 2011
Log: Add client application meta datum.
http://code.google.com/p/ndt/source/detail?r=460

Modified:
/trunk/src/logging.c
/trunk/src/logging.h
/trunk/src/test_meta.h
/trunk/src/test_meta_clt.c
/trunk/src/test_meta_srv.c

=======================================
--- /trunk/src/logging.c Sun May 8 04:04:21 2011
+++ /trunk/src/logging.c Fri Aug 5 09:53:31 2011
@@ -549,6 +549,7 @@
fprintf(fp, "client hostname: %s\n", meta.client_name);
fprintf(fp, "client OS name: %s\n", meta.client_os);
fprintf(fp, "client_browser name: %s\n", meta.client_browser);
+ fprintf(fp, "client_application name: %s\n", meta.client_application);
fprintf(fp, "Summary data: %s\n", meta.summary);
if (meta.additional) {
fprintf(fp, " * Additional data:\n");
=======================================
--- /trunk/src/logging.h Sun May 8 04:04:21 2011
+++ /trunk/src/logging.h Fri Aug 5 09:53:31 2011
@@ -56,6 +56,7 @@
char client_name[64];
char client_os[32];
char client_browser[32];
+ char client_application[32];
int ctl_port;
char server_ip[64];
char server_name[64];
=======================================
--- /trunk/src/test_meta.h Sun May 8 04:04:21 2011
+++ /trunk/src/test_meta.h Fri Aug 5 09:53:31 2011
@@ -12,6 +12,7 @@
#define META_BROWSER_OS "client.browser.name"
#define META_CLIENT_KERNEL_VERSION "client.kernel.version"
#define META_CLIENT_VERSION "client.version"
+#define META_CLIENT_APPLICATION "client.application"

int test_meta_clt(int ctlSocket, char tests, char* host, int conn_options);

=======================================
--- /trunk/src/test_meta_clt.c Sun May 8 04:04:21 2011
+++ /trunk/src/test_meta_clt.c Fri Aug 5 09:53:31 2011
@@ -66,6 +66,9 @@
sprintf(buff, "%s:%s", META_BROWSER_OS, "- (web100clt)");
send_msg(ctlSocket, TEST_MSG, buff, strlen(buff));

+ sprintf(buff, "%s:%s", META_CLIENT_APPLICATION, "cli");
+ send_msg(ctlSocket, TEST_MSG, buff, strlen(buff));
+
if ((fp = fopen("/proc/sys/kernel/osrelease", "r")) == NULL) {
log_println(0, "Unable to determine client kernel version.");
} else {
=======================================
--- /trunk/src/test_meta_srv.c Sun May 8 04:04:21 2011
+++ /trunk/src/test_meta_srv.c Fri Aug 5 09:53:31 2011
@@ -46,17 +46,17 @@

j = send_msg(ctlsockfd, TEST_PREPARE, "", 0);
if (j == -1 || j == -2) {
- log_println(6, "META Error!, Test start message not sent!");
- return j;
+ log_println(6, "META Error!, Test start message not sent!");
+ return j;
}

if (send_msg(ctlsockfd, TEST_START, "", 0) < 0) {
- log_println(6, "META test - Test-start message failed");
- }
-
- while (1) {
- msgLen = sizeof(buff);
- if (recv_msg(ctlsockfd, &msgType, buff, &msgLen)) {
+ log_println(6, "META test - Test-start message failed");
+ }
+
+ while (1) {
+ msgLen = sizeof(buff);
+ if (recv_msg(ctlsockfd, &msgType, buff, &msgLen)) {
log_println(0, "Protocol error!");
sprintf(buff, "Server (META test): Invalid meta data received");
send_msg(ctlsockfd, MSG_ERROR, buff, strlen(buff));
@@ -100,21 +100,26 @@
/*continue;*/
}

- if (new_entry) {
- new_entry->next = (struct metaentry *) malloc(sizeof(struct metaentry));
- new_entry = new_entry->next;
- }
- else {
- new_entry = (struct metaentry *) malloc(sizeof(struct metaentry));
- meta.additional = new_entry;
- }
- snprintf(new_entry->key, sizeof(new_entry->key), "%s", buff);
- snprintf(new_entry->value, sizeof(new_entry->value), "%s", value);
- }
-
- if (send_msg(ctlsockfd, TEST_FINALIZE, "", 0) < 0) {
- log_println(6, "META test - failed to send finalize message");
- }
+ if (strcmp(META_CLIENT_APPLICATION, buff) == 0) {
+ snprintf(meta.client_application, sizeof(meta.client_application), "%s", value);
+ /*continue;*/
+ }
+
+ if (new_entry) {
+ new_entry->next = (struct metaentry *) malloc(sizeof(struct metaentry));
+ new_entry = new_entry->next;
+ }
+ else {
+ new_entry = (struct metaentry *) malloc(sizeof(struct metaentry));
+ meta.additional = new_entry;
+ }
+ snprintf(new_entry->key, sizeof(new_entry->key), "%s", buff);
+ snprintf(new_entry->value, sizeof(new_entry->value), "%s", value);
+ }
+
+ if (send_msg(ctlsockfd, TEST_FINALIZE, "", 0) < 0) {
+ log_println(6, "META test - failed to send finalize message");
+ }

log_println(1, " <-------------------------->");
setCurrentTest(TEST_NONE);


  • [ndt-dev] [ndt] r460 committed - Add client application meta datum., ndt, 08/05/2011

Archive powered by MHonArc 2.6.16.

Top of Page