dark-Matter

0001-assignment-commit.patch

Aug 7th, 2020
256
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.55 KB | None | 0 0
  1. From e49987befcf75b47456ff92aae749b16634dba27 Mon Sep 17 00:00:00 2001
  2. From: Shubhamkumar Pandey <b18194@students.iitmandi.ac.in>
  3. Date: Fri, 7 Aug 2020 11:15:17 +0530
  4. Subject: [PATCH] assignment commit
  5.  
  6. Added few comments as per assignment task.
  7. here is the proof of that running:
  8. some of the lines from error_log
  9. ```
  10. Shubham ended with D [07/Aug/2020:11:06:27.731775 +0530] [Client 2] cupsdWriteClient error=0, used=0, state=HTTP_STATE_POST_SEND, data_encoding=HTTP_ENCODING_LENGTH, data_remaining=116, response=0x55cb3c70bc80(IPP_STATE_DATA), pipe_pid=0, file=-1
  11. Shubham ended with D [07/Aug/2020:11:06:27.731800 +0530] [Client 2] Writing IPP response, ipp_state=IPP_STATE_DATA, old wused=0, new wused=0
  12. Shubham ended with D [07/Aug/2020:11:06:27.731822 +0530] [Client 2] bytes=0, http_state=0, data_remaining=116
  13. Shubham is open printing
  14. Shubham ended with D [07/Aug/2020:11:06:27.731927 +0530] [Client 2] Flushing write buffer.
  15. Shubham ended with D [07/Aug/2020:11:06:27.731934 +0530] [Client 2] New state is HTTP_STATE_WAITING
  16. Shubham ended with d [07/Aug/2020:11:06:27.731942 +0530] cupsdAddSelect(fd=11, read_cb=0x55cb3bbc2ccf, write_cb=(nil), data=0x55cb3c70a7e0)
  17. ```
  18. Signed-off-by: Shubhamkumar Pandey <b18194@students.iitmandi.ac.in>
  19. ---
  20. scheduler/log.c | 13 ++++++-------
  21. 1 file changed, 6 insertions(+), 7 deletions(-)
  22.  
  23. diff --git a/scheduler/log.c b/scheduler/log.c
  24. index 2bd1952f7..6aed05228 100644
  25. --- a/scheduler/log.c
  26. +++ b/scheduler/log.c
  27. @@ -1151,7 +1151,7 @@ cupsdLogRequest(cupsd_client_t *con, /* I - Request to log */
  28. #ifdef HAVE_SYSTEMD_SD_JOURNAL_H
  29. if (!strcmp(AccessLog, "syslog"))
  30. {
  31. - sd_journal_print(LOG_INFO, "REQUEST %s - %s \"%s %s HTTP/%d.%d\" %d " CUPS_LLFMT " %s %s", con->http->hostname, con->username[0] != '\0' ? con->username : "-", states[con->operation], _httpEncodeURI(temp, con->uri, sizeof(temp)), con->http->version / 100, con->http->version % 100, code, CUPS_LLCAST con->bytes, con->request ? ippOpString(con->request->request.op.operation_id) : "-", con->response ? ippErrorString(con->response->request.status.status_code) : "-");
  32. + sd_journal_print(LOG_INFO, "Shubham REQUESTs %s - %s \"%s %s HTTP/%d.%d\" %d " CUPS_LLFMT " %s %s", con->http->hostname, con->username[0] != '\0' ? con->username : "-", states[con->operation], _httpEncodeURI(temp, con->uri, sizeof(temp)), con->http->version / 100, con->http->version % 100, code, CUPS_LLCAST con->bytes, con->request ? ippOpString(con->request->request.op.operation_id) : "-", con->response ? ippErrorString(con->response->request.status.status_code) : "-");
  33. return (1);
  34. }
  35.  
  36. @@ -1163,7 +1163,7 @@ cupsdLogRequest(cupsd_client_t *con, /* I - Request to log */
  37. if (!strcmp(AccessLog, "syslog"))
  38. {
  39. syslog(LOG_INFO,
  40. - "REQUEST %s - %s \"%s %s HTTP/%d.%d\" %d " CUPS_LLFMT " %s %s\n",
  41. + "Shubham REQUESTs %s - %s \"%s %s HTTP/%d.%d\" %d " CUPS_LLFMT " %s %s\n",
  42. con->http->hostname, con->username[0] != '\0' ? con->username : "-",
  43. states[con->operation], _httpEncodeURI(temp, con->uri, sizeof(temp)),
  44. con->http->version / 100, con->http->version % 100,
  45. @@ -1172,7 +1172,6 @@ cupsdLogRequest(cupsd_client_t *con, /* I - Request to log */
  46. ippOpString(con->request->request.op.operation_id) : "-",
  47. con->response ?
  48. ippErrorString(con->response->request.status.status_code) : "-");
  49. -
  50. return (1);
  51. }
  52. #endif /* HAVE_SYSTEMD_SD_JOURNAL_H */
  53. @@ -1189,7 +1188,7 @@ cupsdLogRequest(cupsd_client_t *con, /* I - Request to log */
  54. */
  55.  
  56. cupsFilePrintf(AccessFile,
  57. - "%s - %s %s \"%s %s HTTP/%d.%d\" %d " CUPS_LLFMT " %s %s\n",
  58. + "Shubham prompts %s - %s %s \"%s %s HTTP/%d.%d\" %d " CUPS_LLFMT " %s %s\n",
  59. con->http->hostname,
  60. con->username[0] != '\0' ? con->username : "-",
  61. cupsdGetDateTime(&(con->start), LogTimeFormat),
  62. @@ -1202,9 +1201,9 @@ cupsdLogRequest(cupsd_client_t *con, /* I - Request to log */
  63. con->response ?
  64. ippErrorString(con->response->request.status.status_code) :
  65. "-");
  66. -
  67. cupsFileFlush(AccessFile);
  68. -
  69. + cupsFilePrintf(ErrorFile, "Shubham is open printing\n");
  70. + cupsFileFlush(ErrorFile);
  71. return (1);
  72. }
  73.  
  74. @@ -1268,7 +1267,7 @@ cupsdWriteErrorLog(int level, /* I - Log level */
  75. * Write the log message...
  76. */
  77.  
  78. - cupsFilePrintf(ErrorFile, "%c %s %s\n", levels[level],
  79. + cupsFilePrintf(ErrorFile, "Shubham ended with %c %s %s\n", levels[level],
  80. cupsdGetDateTime(NULL, LogTimeFormat), message);
  81. cupsFileFlush(ErrorFile);
  82. }
  83. --
  84. 2.25.1
  85.  
  86.  
Add Comment
Please, Sign In to add comment