Sponsored Content
Full Discussion: Fix a change I made
Contact Us Post Here to Contact Site Administrators and Moderators Fix a change I made Post 303021621 by Neo on Monday 13th of August 2018 12:54:55 PM
Old 08-13-2018
Image
 

9 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Can this be made into one single line?

Can someone please suggest a script to make the following into one single (continuous) line so that a pattern search can be carried out on the resulting single line. Note : Sample (may be shorter or longer) and will be contained in a text file ... (6 Replies)
Discussion started by: nmsinghe
6 Replies

2. UNIX for Dummies Questions & Answers

monitor changes made by root

Is there any way in Solaris 9 to monitor changes made to user accounts by root? (0 Replies)
Discussion started by: scriptarg
0 Replies

3. Cybersecurity

Help - Made a serious admin error

Hello, I am a newbie to Unix administration (specifically Solaris 9). I have everything setup properly for auditing but I neglected to realize I needed to start a new logfile each week. Thus the one logfile grew to about 2.5GB before the auditreduce command could no longer process the file. ... (4 Replies)
Discussion started by: jtbates
4 Replies

4. UNIX for Advanced & Expert Users

How to : Identify changes made with root ?

Thanks Avklinux (1 Reply)
Discussion started by: avklinux
1 Replies

5. Shell Programming and Scripting

strtotime() error - no changes made

Not sure what happened, this page/code always worked before, no changes were made to the code, only the box was powered down, moved and powered back up, the code seems to still be doing its job but spewing out these errors right on the page. Again no changes were made. Warning: strtotime()... (1 Reply)
Discussion started by: ippy98
1 Replies

6. UNIX for Dummies Questions & Answers

Made something wrong in server

hello friends, l was using this command to empty tmp directory but l made this by mistake : and l cant reach my sites now. what l did ??? ---------- Post updated 11-13-11 at 12:07 AM ---------- Previous update was 11-12-11 at... (3 Replies)
Discussion started by: rcpkrc
3 Replies

7. AIX

How to check changes made in last few weeks?

Hi, I want to know what changes were made to my AIX system in last few weeks/months. Is there any command that I can use for this? I am facing a problem wherein my program which are built few weeks back runs fine but if I build the same program now, it doesn't run as expected. ... (4 Replies)
Discussion started by: shriashishpatil
4 Replies

8. What is on Your Mind?

Self made monitoring application

Hi.. Looking for advice / feedback Work in IT in an operational team, number of years ago, all monitoring was manual, vast checklists for unix checks, checking space, checking application processes, files etc. filling in spreadsheets etc. I took some basic scripting courses in ksh and... (2 Replies)
Discussion started by: frustrated1
2 Replies

9. What is on Your Mind?

An email that has made my day...

Today I received an email from 'code.activestate.com'. It was referenced to a Python code snippet I wrote 3 years and 2 months ago. It was the third party comment at the bottom that was emailed to me... As I am a pure amateur coder this has really made my day... Platform Independent... (1 Reply)
Discussion started by: wisecracker
1 Replies
AnyEvent::HTTPD::Request(3pm)				User Contributed Perl Documentation			     AnyEvent::HTTPD::Request(3pm)

NAME
AnyEvent::HTTPD::Request - A web application request handle for AnyEvent::HTTPD DESCRIPTION
This is the request object as generated by AnyEvent::HTTPD and given in the request callbacks. METHODS
url This method returns the URL of the current request as URI object. respond ([$res]) $res can be: o an array reference Then the array reference has these elements: my ($code, $message, $header_hash, $content) = [200, 'ok', { 'Content-Type' => 'text/html' }, '<h1>Test</h1>' }] You can remove most headers added by default (like "Cache-Control", "Expires", and "Content-Length") by setting them to undef, like so: $req->respond([ 200, 'OK', { 'Content-Type' => 'text/html', 'Cache-Control' => 'max-age=3600', 'Expires' => undef, }, 'This data will be cached for one hour.' ]); o a hash reference If it was a hash reference the hash is first searched for the "redirect" key and if that key does not exist for the "content" key. The value for the "redirect" key should contain the URL that you want to redirect the request to. The value for the "content" key should contain an array reference with the first value being the content type and the second the content. Here is an example: $httpd->reg_cb ( '/image/elmex' => sub { my ($httpd, $req) = @_; open IMG, "$ENV{HOME}/media/images/elmex.png" or $req->respond ( [404, 'not found', { 'Content-Type' => 'text/plain' }, 'not found'] ); $req->respond ({ content => ['image/png', do { local $/; <IMG> }] }); } ); How to send large files: For longer responses you can give a callback instead of a string to the response function for the value of the $content. $req->respond ({ content => ['video/x-ms-asf', sub { my ($data_cb) = @_; # start some async retrieve operation, for example use # IO::AIO (with AnyEvent::AIO). Or retrieve chunks of data # to send somehow else. } }); The given callback will receive as first argument either another callback ($data_cb in the above example) or an undefined value, which means that there is no more data required and the transfer has been completed (either by you sending no more data, or by a disconnect of the client). The callback given to "respond" will be called whenever the send queue of the HTTP connection becomes empty (meaning that the data is written out to the kernel). If it is called you have to start delivering the next chunk of data. That doesn't have to be immediately, before the callback returns. This means that you can initiate for instance an IO::AIO request (see also AnyEvent::AIO) and send the data later. That is what the $data_cb callback is for. You have to call it once you got the next chunk of data. Once you sent a chunk of data via $data_cb you can just wait until your callback is called again to deliver the next chunk. If you are done transferring all data call the $data_cb with an empty string or with no argument at all. Please consult the example script "large_response_example" from the "samples/" directory of the AnyEvent::HTTPD distribution for an example of how to use this mechanism. NOTE: You should supply a 'Content-Length' header if you are going to send a larger file. If you don't do that the client will have no chance to know if the transfer was complete. To supply additional header fields the hash argument format will not work. You should use the array argument format for this case. responded Returns true if this request already has been responded to. parm ($key) Returns the first value of the form parameter $key or undef. params Returns list of parameter names. vars Returns a hash of form parameters. The value is either the value of the parameter, and in case there are multiple values present it will contain an array reference of values. method This method returns the method of the current request. content Returns the request content or undef if only parameters for a form were transmitted. headers This method will return a hash reference containing the HTTP headers for this HTTP request. client_host This method returns the host/IP of the HTTP client this request was received from. client_port This method returns the TCP port number of the HTTP client this request was received from. COPYRIGHT &; LICENSE Copyright 2008-2011 Robin Redeker, all rights reserved. This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself. perl v5.14.2 2011-08-04 AnyEvent::HTTPD::Request(3pm)
All times are GMT -4. The time now is 03:44 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy