rejetto forum
May 26, 2012, 01:45:02 AM *
Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
News: This forum is free, you do NOT need to register to post. But you may.
PROBLEMS? QUESTIONS? CLICK HERE!
Fill the survey!
 
   Home   Help Search Login Register  
Pages: [1] 2
  Print  
Author Topic: Macros to serve HTTP status codes  (Read 2336 times)
0 Members and 1 Guest are viewing this topic.
raybob
Tireless poster
****
Offline Offline

United States United States

Posts: 206



View Profile WWW
« on: August 16, 2011, 08:43:21 PM »

Can you create a macro command to directly serve different HTTP codes to the user, for example something like {.if| I want to give this user a deny-403 code |{:{.serve|403.}:}.}

Reason I ask is because in certain cases I want to direct a user to the deny page but using {.redirect|/~deny.} will confuse search engines and browsers into thinking that the page exists and is accessible but got temporarily moved....  This would also be useful for serving a 307 code since using {.redirect.} only constitutes a temporary redirect, not a permanent one.

Thanks!
« Last Edit: August 19, 2011, 10:46:01 PM by raybob95 » Logged
FRENCH CAN CAN
Insane poster
*****
Offline Offline

Italy Italy

Posts: 641


View Profile
« Reply #1 on: August 18, 2011, 06:38:07 AM »

At the head section of your template:

<meta name="robots" content="noindex,nofollow,noarchive,nosnippet">

you should get the desired effect.
Logged
raybob
Tireless poster
****
Offline Offline

United States United States

Posts: 206



View Profile WWW
« Reply #2 on: August 19, 2011, 03:51:34 PM »

No, I'm looking for a way to actually use a macro to serve HTTP status codes of my choosing in the response headers; for users not just search engines, and for a variety of applications.
« Last Edit: August 19, 2011, 10:47:08 PM by raybob95 » Logged
raybob
Tireless poster
****
Offline Offline

United States United States

Posts: 206



View Profile WWW
« Reply #3 on: September 02, 2011, 11:33:44 AM »

Like {.if| I want to hide this page |{:{.http status|404.}:}.} or {.if| I want to deny this user |{:{.http status|403.}:}.}  or  {.if| I permanently moved this file |{:{.http status|301.}{.add header|Location: http://website.tld/.}:}.}

Something to that effect would be very useful.

This can very easily be done in PHP...  <?php header("HTTP/1.1 404 Not Found"); ?>
« Last Edit: September 02, 2011, 11:36:17 AM by raybob95 » Logged
rejetto
Administrator
Insane programmer
*
Offline Offline

Italy Italy

Posts: 11831


View Profile
« Reply #4 on: September 17, 2011, 12:48:12 PM »

yes i mean to add something like that.
that was already in the to-do list, in this line

+ macros missing to cache a folder: {.reply|content=|var=|code=|filename=|mime=.}


i meant it as a way to provide cached content, but it would work for your purpose too.
keep an eye on future builds for new commands.
unfortunately i didn't solve my problems stopping me from developing hfs yet. Sad
Logged
raybob
Tireless poster
****
Offline Offline

United States United States

Posts: 206



View Profile WWW
« Reply #5 on: September 18, 2011, 01:02:19 PM »

Rather than creating a new topic, I'll just ask here....

Have you ever thought about creating a command that functions similar to javascript setTimeout() or PHP sleep()
« Last Edit: September 18, 2011, 09:12:07 PM by raybob95 » Logged
rejetto forum
« Reply #5 on: September 18, 2011, 01:02:19 PM »

Do you like this software? Consider even $2
 Logged
rejetto
Administrator
Insane programmer
*
Offline Offline

Italy Italy

Posts: 11831


View Profile
« Reply #6 on: October 04, 2011, 04:40:13 AM »

mmm, nope.
But sleep is out of question because HFS is not multi-threaded.
Would you need a setTimeout ?
Logged
raybob
Tireless poster
****
Offline Offline

United States United States

Posts: 206



View Profile WWW
« Reply #7 on: October 07, 2011, 10:24:55 AM »

But sleep is out of question because HFS is not multi-threaded.

Is that something you plan on doing in the future is making HFS multithreaded?  Perhaps one thread per connection would be effective Smiley

HFS frequently maxes out my CPU on its allotted core (and this is a Core i7 here) and then the GUI freezes up....

Generally if I have >8 active downloads HFS lags to the point that it's basically knocked offline because I can't even access it from within my LAN in under a minute.  That's on a VM server with an i7 and 3GB RAM.

EDIT:

Also I ask about setTimeout or something like that because capturing the output of a batch file only works if the batch takes under a certain amount of time to complete, like HFS doesn't wait for it.
« Last Edit: October 16, 2011, 08:00:18 PM by raybob95 » Logged
rejetto
Administrator
Insane programmer
*
Offline Offline

Italy Italy

Posts: 11831


View Profile
« Reply #8 on: October 23, 2011, 01:32:03 PM »

Is that something you plan on doing in the future is making HFS multithreaded?

that won't come until a full rewrite of HFS.
would i have the time, i would go for a multiplatform version based on Python.

Quote
Generally if I have >8 active downloads HFS lags to the point that it's basically knocked offline because I can't even access it from within my LAN in under a minute.  That's on a VM server with an i7 and 3GB RAM.

wow. What's the total upload speed at that moment?

Quote
Also I ask about setTimeout or something like that because capturing the output of a batch file only works if the batch takes under a certain amount of time to complete, like HFS doesn't wait for it.

but you don't know how long will the batch take, right?
you may wait too long, or arrive too early.
it's better if the "fetcher" of the result is in a timed event, isn't it?
Logged
rejetto
Administrator
Insane programmer
*
Offline Offline

Italy Italy

Posts: 11831


View Profile
« Reply #9 on: October 23, 2011, 01:33:32 PM »

Bandalit moved to http://www.rejetto.com/forum/index.php/topic,9941.0.html
Logged
raybob
Tireless poster
****
Offline Offline

United States United States

Posts: 206



View Profile WWW
« Reply #10 on: October 30, 2011, 12:35:25 PM »

wow. What's the total upload speed at that moment?

My internet doesn't go above 120KB/s (which is slightly problematic).  HFS doesn't lag based on total upload speed but rather number of concurrent connections.  I can easily get over 8MB/s with no lag on my local LAN if no one else is connected.

That being said there is a total of ~200 macros that get executed under [request] according to the macro-log and 542 items in my VFS   Grin

Do you think the fact that it's under a VM has much effect?  Every other application seems to run the same speed...

BTW what I said before wasn't totally accurate.... here's what I measured: >4 downloads makes the GUI slower, >10 downloads makes the GUI unusable by taking >10 seconds to show anything, >12 downloads makes a page take longer than 10 seconds to load and >15-20 downloads will make Firefox time out when loading a page.  HFS has only been knocked offline once for me (completely unresponsive in GUI and over HTTP) and it had around 30 (concurrent) downloads.

I also tried disabling browsing compression but it didn't seem to have an effect.
« Last Edit: October 30, 2011, 07:58:21 PM by raybob95 » Logged
rejetto
Administrator
Insane programmer
*
Offline Offline

Italy Italy

Posts: 11831


View Profile
« Reply #11 on: October 31, 2011, 01:39:18 PM »

your [request] script is executed only at the beginning of the connection.
in case the gui is slow also when no connections are established, it must be something else.
a quick test could be done by disabling your scripts for a while: you can just rename the hfs.events file
Logged
raybob
Tireless poster
****
Offline Offline

United States United States

Posts: 206



View Profile WWW
« Reply #12 on: October 31, 2011, 04:00:47 PM »

I'll try that next time I get heavy traffic.
Logged
raybob
Tireless poster
****
Offline Offline

United States United States

Posts: 206



View Profile WWW
« Reply #13 on: November 10, 2011, 11:39:50 PM »

Disabling events actually didn't seem to have an effect.

Today during some heavy traffic I tried temporarily disabling options and I managed to hit a record of 8 HTTP requests/second (something like 1000 HTTP packets per second) with literally zero lag.  It was pretty cool  Cheesy  Restoring the options pretty much immediately locked up the interface.

The following things I tried all had no effect:

Disabling Apache Log
Disabling Compressed Browsing
Disabling preventing download accelerators
clearing ban list
turning off high speed handling
« Last Edit: November 11, 2011, 11:37:38 AM by raybob » Logged
rejetto
Administrator
Insane programmer
*
Offline Offline

Italy Italy

Posts: 11831


View Profile
« Reply #14 on: November 13, 2011, 04:57:30 PM »

i didn't understand, what's the result you just told, was it something different? and how did you get it?
Logged
Pages: [1] 2
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.16 | SMF © 2011, Simple Machines Valid XHTML 1.0! Valid CSS!


Google visited last this page May 24, 2012, 12:24:08 PM
anything