/*
* digest_file_auth.cc
*
- * AUTHOR: Robert Collins. Based on ncsa_auth.c by Arjan de Vet
- * <Arjan.deVet@adv.iae.nl>
- * LDAP backend extension by Flavio Pescuma, MARA Systems AB <flavio@marasystems.com>
+ * AUTHOR: Robert Collins.
+ *
+ * Based on ncsa_auth.c by Arjan de Vet <Arjan.deVet@adv.iae.nl>
+ *
+ * LDAP backend extension by Flavio Pescuma,
+ * MARA Systems AB <flavio@marasystems.com>
*
* Example digest authentication program for Squid, based on the original
* proxy_auth code from client_side.c, written by
* Copyright (c) 2003 Robert Collins <robertc@squid-cache.org>
*/
-#include "config.h"
+#include "squid.h"
#include "digest_common.h"
+#include "helpers/defines.h"
#include "text_backend.h"
#define PROGRAM_NAME "digest_file_auth"
requestData->error = 0;
GetHHA1(requestData);
if (requestData->error) {
- printf("ERR No such user\n");
+ SEND_ERR("No such user");
return;
}
printf("%s\n", requestData->HHA1);
RequestData requestData;
ParseBuffer(buf, &requestData);
if (!requestData.parsed) {
- printf("ERR\n");
+ SEND_ERR("");
return;
}
OutputHHA1(&requestData);
int
main(int argc, char **argv)
{
- char buf[256];
+ char buf[HELPER_INPUT_BUFFER];
setbuf(stdout, NULL);
ProcessArguments(argc, argv);
- while (fgets(buf, 256, stdin) != NULL)
+ while (fgets(buf, HELPER_INPUT_BUFFER, stdin) != NULL)
DoOneRequest(buf);
return 0;
}