* ABRT server protocol
*/
sprintf(buf, "PUT / HTTP/1.1\r\n\r\n");
- rc = write(sockfd, buf, strlen(buf) + 1);
- if(rc < strlen(buf) + 1){
+ rc = write(sockfd, buf, strlen(buf));
+ if(rc < strlen(buf)){
return -1;
}
return -1;
}
- sprintf(buf, "BASENAME=%s", "rasdaemon");
+ sprintf(buf, "TYPE=%s", "ras");
rc = write(sockfd, buf, strlen(buf) + 1);
if(rc < strlen(buf) + 1){
return -1;
return 0;
}
-/*
- * add "DONE" string to finish message.
- */
-static int commit_report_done(int sockfd){
- int rc = -1;
-
- if(sockfd < 0){
- return -1;
- }
-
- rc = write(sockfd, "DONE\0", strlen("DONE\0"));
- if(rc < strlen("DONE\0")){
- return -1;
- }
-
- return 0;
-}
-
static int set_mc_event_backtrace(char *buf, struct ras_mc_event *ev){
char bt_buf[MAX_BACKTRACE_SIZE];
if(!buf || !ev)
return -1;
- sprintf(bt_buf, "BACKTRACE= " \
+ sprintf(bt_buf, "BACKTRACE=" \
"timestamp=%s\n" \
"error_count=%d\n" \
"error_type=%s\n" \
goto mc_fail;
}
- rc = commit_report_done(sockfd);
- if(rc < 0){
- goto mc_fail;
- }
-
done = 1;
mc_fail:
goto aer_fail;
}
- rc = commit_report_done(sockfd);
- if(rc < 0){
- goto aer_fail;
- }
-
done = 1;
aer_fail:
goto mce_fail;
}
- rc = commit_report_done(sockfd);
- if(rc < 0){
- goto mce_fail;
- }
-
done = 1;
mce_fail: